java.lang.Object
io.github.projectunified.cronutils.model.definition.CronDefinition
All Implemented Interfaces:
Serializable

public class CronDefinition extends Object implements Serializable
Defines fields and conditions over each field for a cron. The class is thread safe.
See Also:
  • Constructor Details

    • CronDefinition

      public CronDefinition(List<FieldDefinition> fieldDefinitions, Set<CronConstraint> cronConstraints, Set<CronNicknames> cronNicknames, boolean matchDayOfWeekAndDayOfMonth)
      Constructor.
      Parameters:
      fieldDefinitions - - list with field definitions. Must not be null or empty. Throws a NullPointerException if a null values is received Throws an IllegalArgumentException if an empty list is received
  • Method Details

    • isMatchDayOfWeekAndDayOfMonth

      public boolean isMatchDayOfWeekAndDayOfMonth()
      If both the day of the week and day of the month should be matched.
      Returns:
      true if both should be matched, false otherwise
    • getFieldDefinitions

      public Set<FieldDefinition> getFieldDefinitions()
      Returns field definitions for this cron.
      Returns:
      Set of FieldDefinition instances, never null.
    • retrieveFieldDefinitionsAsMap

      public Map<CronFieldName,FieldDefinition> retrieveFieldDefinitionsAsMap()
      Retrieve all cron field definitions values as map.
      Returns:
      unmodifiable Map with key CronFieldName and values FieldDefinition, never null
    • getFieldDefinition

      public FieldDefinition getFieldDefinition(CronFieldName cronFieldName)
      Returns field definition for field name of this cron.
      Parameters:
      cronFieldName - cron field name
      Returns:
      FieldDefinition instance
    • containsFieldDefinition

      public boolean containsFieldDefinition(CronFieldName cronFieldName)
      Returns true if this cron contains a field definition for field name.
      Parameters:
      cronFieldName - cron field name
      Returns:
      true if this cron contains a field definition for field name
    • getCronConstraints

      public Set<CronConstraint> getCronConstraints()
    • getCronNicknames

      public Set<CronNicknames> getCronNicknames()
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object