java.lang.Object
io.github.projectunified.cronutils.model.field.definition.FieldDefinition
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DayOfWeekFieldDefinition

public class FieldDefinition extends Object implements Serializable
Represents a definition of allowed values for a cron field.
See Also:
  • Constructor Details

    • FieldDefinition

      public FieldDefinition(CronFieldName fieldName, FieldConstraints constraints)
      Mandatory field Constructor.
      Parameters:
      fieldName - - CronFieldName; name of the field if null, a NullPointerException will be raised.
      constraints - - FieldConstraints, constraints; if null, a NullPointerException will be raised.
    • FieldDefinition

      public FieldDefinition(CronFieldName fieldName, FieldConstraints constraints, boolean optional)
      Constructor.
      Parameters:
      fieldName - - CronFieldName; name of the field if null, a NullPointerException will be raised.
      constraints - - FieldConstraints, constraints; if null, a NullPointerException will be raised.
      optional - - if false the field is mandatory, optional otherwise.
  • Method Details

    • getFieldName

      public CronFieldName getFieldName()
      Retrieve field name.
      Returns:
      CronFieldName instance, never null;
    • getConstraints

      public FieldConstraints getConstraints()
      Get field constraints.
      Returns:
      FieldConstraints instance, never null;
    • isOptional

      public boolean isOptional()
      Get optional tag.
      Returns:
      optional tag
    • createFieldDefinitionComparator

      public static Comparator<FieldDefinition> createFieldDefinitionComparator()
      Creates a field definition comparator. Will compare by CronFieldName order value;
      Returns:
      Comparator for FieldDefinition instance, never null;
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object