java.lang.Object
io.github.projectunified.cronutils.model.field.constraint.FieldConstraints
All Implemented Interfaces:
Serializable

public class FieldConstraints extends Object implements 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 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 value
      endRange - - highest possible value
      strictRange - - 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

      public Set<SpecialChar> 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:
      true if period is compatible, false otherwise.
    • getStringMappingKeySet

      public Set<String> getStringMappingKeySet()
    • getStringMappingValue

      public Integer getStringMappingValue(String exp)
    • getIntMappingValue

      public Integer getIntMappingValue(Integer exp)
    • isStrictRange

      public boolean isStrictRange()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object