001/* 002 * SPDX-FileCopyrightText: none 003 * SPDX-License-Identifier: CC0-1.0 004 */ 005 006package dev.metaschema.databind.model.annotations; 007 008import static java.lang.annotation.RetentionPolicy.RUNTIME; 009 010import java.lang.annotation.Documented; 011import java.lang.annotation.ElementType; 012import java.lang.annotation.Retention; 013import java.lang.annotation.Target; 014 015import edu.umd.cs.findbugs.annotations.NonNull; 016 017/** 018 * Defines constraints that apply to assembly definitions. 019 */ 020@Documented 021@Retention(RUNTIME) 022@Target(ElementType.ANNOTATION_TYPE) 023public @interface AssemblyConstraints { 024 /** 025 * Get the index constraints for this assembly. 026 * 027 * @return the index constraints or an empty array if no index constraints are 028 * defined 029 */ 030 @NonNull 031 Index[] index() default {}; 032 033 /** 034 * Get the unique constraints for this assembly. 035 * 036 * @return the unique constraints or an empty array if no unique constraints are 037 * defined 038 */ 039 @NonNull 040 IsUnique[] unique() default {}; 041 042 /** 043 * Get the cardinality constraints for this assembly. 044 * 045 * @return the cardinality constraints or an empty array if no cardinality 046 * constraints are defined 047 */ 048 @NonNull 049 HasCardinality[] cardinality() default {}; 050}