Class FieldDomain

  • All Implemented Interfaces:
    Serializable

    public final class FieldDomain
    extends Object
    implements Serializable
    Contains meta-information about the allowed values, lower, and upper bounds for a given field.
    See Also:
    Serialized Form
    • Field Detail

      • UNSPECIFIED

        public static final FieldDomain UNSPECIFIED
        The unspecified field domain
    • Constructor Detail

      • FieldDomain

        public FieldDomain​(ScalarValued lowerBound,
                           ScalarValued upperBound,
                           Set<? extends ScalarValued> values)
        Creates a new field domain
        Parameters:
        lowerBound - the lower bound or null if unknown
        upperBound - the upper bound of null if unknown
        values - the possible values. Note that either null or the empty set is interpreted is unknown. The value of getValues() will always be normalized to the empty set in the case of unknown.
    • Method Detail

      • getLowerBound

        public ScalarValued getLowerBound()
        Returns the lower bound of the field or null if unknown
        Returns:
        the lower bound of the field
      • getUpperBound

        public ScalarValued getUpperBound()
        Returns the upper bound of the field or null if unknown
        Returns:
        the upper bound of the field
      • getValues

        public Set<ScalarValued> getValues()
        Returns the allowed values of the field or empty if unknown.
        Returns:
        the allowed values of the field
      • checkType

        public void checkType​(String field,
                              ScalarTokenType type)
        Checks that the type of the domain matches the type of the field
        Parameters:
        field - the name of the field, used for error handling
        type - the type of the field
        Throws:
        IllegalArgumentException - if domain is invalid
      • isSpecified

        public boolean isSpecified()
        Returns true if lower bound, upper bound, or values are specified
        Returns:
        true if lower bound, upper bound, or values are specified
      • hasDomainValues

        public boolean hasDomainValues()
        Returns true if values are specified
        Returns:
        true if values are specified
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object