Interface ICardinalityConstraint

All Superinterfaces:
IAttributable, IConfigurableMessageConstraint, IConstraint, IDescribable

public interface ICardinalityConstraint extends IConfigurableMessageConstraint
Represents a rule requiring a Metaschema assembly data instance to have elements with a minimum and/or maximum occurrence.
  • Method Details

    • getType

      default IConstraint.Type getType()
      Description copied from interface: IConstraint
      Get the constraint type.
      Specified by:
      getType in interface IConstraint
      Returns:
      the constraint type
    • getMinOccurs

      @Nullable Integer getMinOccurs()
      Retrieve the required minimum occurrence of the target instance. If specified, this value must be less than or equal to the value of IGroupable.getMaxOccurs() and greater than IGroupable.getMinOccurs().
      Returns:
      a non-negative integer or null if not defined
    • getMaxOccurs

      @Nullable Integer getMaxOccurs()
      Retrieve the required maximum occurrence of the target instance. If specified, this value must be less than the value of IGroupable.getMaxOccurs() and greater than or equal to IGroupable.getMinOccurs().
      Returns:
      a non-negative integer or null if not defined
    • accept

      default <T, R> R accept(IConstraintVisitor<T,R> visitor, T state)
      Description copied from interface: IConstraint
      Used for double dispatch supporting the visitor pattern provided by implementations of IConstraintVisitor.
      Specified by:
      accept in interface IConstraint
      Type Parameters:
      T - the Java type of a state object passed to the visitor
      R - the Java type of the result returned by the visitor methods
      Parameters:
      visitor - the visitor implementation
      state - the state object passed to the visitor
      Returns:
      the visitation result
      See Also:
    • builder

      @NonNull static ICardinalityConstraint.Builder builder()
      Create a new constraint builder.
      Returns:
      the builder