Class CronDefinition
java.lang.Object
io.github.projectunified.cronutils.model.definition.CronDefinition
- All Implemented Interfaces:
Serializable
Defines fields and conditions over each field for a cron.
The class is thread safe.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCronDefinition(List<FieldDefinition> fieldDefinitions, Set<CronConstraint> cronConstraints, Set<CronNicknames> cronNicknames, boolean matchDayOfWeekAndDayOfMonth) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsFieldDefinition(CronFieldName cronFieldName) Returnstrueif this cron contains a field definition for field name.booleangetFieldDefinition(CronFieldName cronFieldName) Returns field definition for field name of this cron.Returns field definitions for this cron.inthashCode()booleanIf both the day of the week and day of the month should be matched.Retrieve all cron field definitions values as map.
-
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
Returns field definitions for this cron.- Returns:
- Set of FieldDefinition instances, never null.
-
retrieveFieldDefinitionsAsMap
Retrieve all cron field definitions values as map.- Returns:
- unmodifiable Map with key CronFieldName and values FieldDefinition, never null
-
getFieldDefinition
Returns field definition for field name of this cron.- Parameters:
cronFieldName- cron field name- Returns:
- FieldDefinition instance
-
containsFieldDefinition
Returnstrueif this cron contains a field definition for field name.- Parameters:
cronFieldName- cron field name- Returns:
trueif this cron contains a field definition for field name
-
getCronConstraints
-
getCronNicknames
-
equals
-
hashCode
public int hashCode()
-