Class FieldConstraints
java.lang.Object
io.github.projectunified.cronutils.model.field.constraint.FieldConstraints
- All Implemented Interfaces:
Serializable
Holds information on valid values for a field and allows to perform mappings and validations. Example of information for valid field
values: int range, valid special characters, valid nominal values. Example for mappings: conversions from nominal values to integers and
integer-integer mappings if more than one integer represents the same concept.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFieldConstraints(Map<String, Integer> stringMapping, Map<Integer, Integer> intMapping, Set<SpecialChar> specialChars, int startRange, int endRange, boolean strictRange) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintintinthashCode()booleanisInRange(int value) Check if given number is greater or equal to start range and minor or equal to end range.booleanisPeriodInRange(int period) Check if given period is compatible with the given range.boolean
-
Constructor Details
-
FieldConstraints
public FieldConstraints(Map<String, Integer> stringMapping, Map<Integer, Integer> intMapping, Set<SpecialChar> specialChars, int startRange, int endRange, boolean strictRange) Constructor.- Parameters:
specialChars- - allowed special chars.startRange- - lowest possible valueendRange- - highest possible valuestrictRange- - if we shall consider strict ranges for this field - regardless global strict ranges criteria
-
-
Method Details
-
getStartRange
public int getStartRange() -
getEndRange
public int getEndRange() -
getSpecialChars
-
isInRange
public boolean isInRange(int value) Check if given number is greater or equal to start range and minor or equal to end range.- Parameters:
value- - to be checked
-
isPeriodInRange
public boolean isPeriodInRange(int period) Check if given period is compatible with the given range.- Parameters:
period- - to be checked- Returns:
trueif period is compatible,falseotherwise.
-
getStringMappingKeySet
-
getStringMappingValue
-
getIntMappingValue
-
isStrictRange
public boolean isStrictRange() -
equals
-
hashCode
public int hashCode()
-