Interface IIndexConstraint

All Superinterfaces:
IAttributable, IConfigurableMessageConstraint, IConstraint, IDescribable, IKeyConstraint

public interface IIndexConstraint extends IKeyConstraint
Represents a rule that generates a key-based index containing references to data items found in a Metaschema data instance.

The generated index can be used to check cross-references between Metaschema data objects using the IIndexHasKeyConstraint.

  • 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
    • getName

      @NonNull String getName()
      Get the identifying name of the index, which is used to refer to the index by an IIndexHasKeyConstraint.
      Returns:
      the name of the index
    • 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 IIndexConstraint.Builder builder(@NonNull String name)
      Create a new constraint builder.
      Parameters:
      name - the identifier for the index
      Returns:
      the builder