1 /*
2 * SPDX-FileCopyrightText: none
3 * SPDX-License-Identifier: CC0-1.0
4 */
5
6 package dev.metaschema.databind.model.annotations;
7
8 import static java.lang.annotation.RetentionPolicy.RUNTIME;
9
10 import java.lang.annotation.Documented;
11 import java.lang.annotation.ElementType;
12 import java.lang.annotation.Retention;
13 import java.lang.annotation.Target;
14
15 import edu.umd.cs.findbugs.annotations.NonNull;
16
17 /**
18 * Defines constraints that apply to assembly definitions.
19 */
20 @Documented
21 @Retention(RUNTIME)
22 @Target(ElementType.ANNOTATION_TYPE)
23 public @interface AssemblyConstraints {
24 /**
25 * Get the index constraints for this assembly.
26 *
27 * @return the index constraints or an empty array if no index constraints are
28 * defined
29 */
30 @NonNull
31 Index[] index() default {};
32
33 /**
34 * Get the unique constraints for this assembly.
35 *
36 * @return the unique constraints or an empty array if no unique constraints are
37 * defined
38 */
39 @NonNull
40 IsUnique[] unique() default {};
41
42 /**
43 * Get the cardinality constraints for this assembly.
44 *
45 * @return the cardinality constraints or an empty array if no cardinality
46 * constraints are defined
47 */
48 @NonNull
49 HasCardinality[] cardinality() default {};
50 }