1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package gov.nist.secauto.metaschema.core.model.constraint;
7   
8   import java.util.List;
9   
10  import edu.umd.cs.findbugs.annotations.NonNull;
11  
12  /**
13   * Represents a container of rules constraining the effective model of a
14   * Metaschema assembly data instance.
15   */
16  public interface IModelConstrained extends IValueConstrained {
17    /**
18     * Get the collection of index constraints, if any.
19     *
20     * @return the constraints or an empty list
21     */
22    @NonNull
23    List<? extends IIndexConstraint> getIndexConstraints();
24  
25    /**
26     * Get the collection of unique constraints, if any.
27     *
28     * @return the constraints or an empty list
29     */
30    @NonNull
31    List<? extends IUniqueConstraint> getUniqueConstraints();
32  
33    /**
34     * Get the collection of cardinality constraints, if any.
35     *
36     * @return the constraints or an empty list
37     */
38    @NonNull
39    List<? extends ICardinalityConstraint> getHasCardinalityConstraints();
40  
41    /**
42     * Add a new constraint.
43     *
44     * @param constraint
45     *          the constraint to add
46     */
47    void addConstraint(@NonNull IIndexConstraint constraint);
48  
49    /**
50     * Add a new constraint.
51     *
52     * @param constraint
53     *          the constraint to add
54     */
55    void addConstraint(@NonNull IUniqueConstraint constraint);
56  
57    /**
58     * Add a new constraint.
59     *
60     * @param constraint
61     *          the constraint to add
62     */
63    void addConstraint(@NonNull ICardinalityConstraint constraint);
64  }