- java.lang.Object
-
- com.pervasive.datarush.types.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 Summary
Fields Modifier and Type Field Description static FieldDomainUNSPECIFIEDThe unspecified field domain
-
Constructor Summary
Constructors Constructor Description FieldDomain(ScalarValued lowerBound, ScalarValued upperBound, Set<? extends ScalarValued> values)Creates a new field domain
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckType(String field, ScalarTokenType type)Checks that the type of the domain matches the type of the fieldbooleanequals(Object obj)ScalarValuedgetLowerBound()Returns the lower bound of the field ornullif unknownScalarValuedgetUpperBound()Returns the upper bound of the field ornullif unknownSet<ScalarValued>getValues()Returns the allowed values of the field oremptyif unknown.booleanhasDomainValues()Returns true if values are specifiedinthashCode()booleanisSpecified()Returns true if lower bound, upper bound, or values are specifiedStringtoString()
-
-
-
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 ornullif unknownupperBound- the upper bound ofnullif unknownvalues- the possible values. Note that eithernullor the empty set is interpreted is unknown. The value ofgetValues()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 ornullif unknown- Returns:
- the lower bound of the field
-
getUpperBound
public ScalarValued getUpperBound()
Returns the upper bound of the field ornullif unknown- Returns:
- the upper bound of the field
-
getValues
public Set<ScalarValued> getValues()
Returns the allowed values of the field oremptyif 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 handlingtype- 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
-
-