Enum WeekendDefinition
- java.lang.Object
-
- java.lang.Enum<WeekendDefinition>
-
- org.optaplanner.examples.nurserostering.domain.WeekendDefinition
-
- All Implemented Interfaces:
Serializable,Comparable<WeekendDefinition>
public enum WeekendDefinition extends Enum<WeekendDefinition>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description FRIDAY_SATURDAY_SUNDAYFRIDAY_SATURDAY_SUNDAY_MONDAYSATURDAY_SUNDAYSATURDAY_SUNDAY_MONDAY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCode()DayOfWeekgetFirstDayOfWeekend()DayOfWeekgetLastDayOfWeekend()intgetWeekendLength()booleanisWeekend(DayOfWeek dayOfWeek)StringtoString()static WeekendDefinitionvalueOf(String name)Returns the enum constant of this type with the specified name.static WeekendDefinitionvalueOfCode(String code)static WeekendDefinition[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SATURDAY_SUNDAY
public static final WeekendDefinition SATURDAY_SUNDAY
-
FRIDAY_SATURDAY_SUNDAY
public static final WeekendDefinition FRIDAY_SATURDAY_SUNDAY
-
FRIDAY_SATURDAY_SUNDAY_MONDAY
public static final WeekendDefinition FRIDAY_SATURDAY_SUNDAY_MONDAY
-
SATURDAY_SUNDAY_MONDAY
public static final WeekendDefinition SATURDAY_SUNDAY_MONDAY
-
-
Method Detail
-
values
public static WeekendDefinition[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (WeekendDefinition c : WeekendDefinition.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static WeekendDefinition valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
valueOfCode
public static WeekendDefinition valueOfCode(String code)
-
getCode
public String getCode()
-
getFirstDayOfWeekend
public DayOfWeek getFirstDayOfWeekend()
-
getLastDayOfWeekend
public DayOfWeek getLastDayOfWeekend()
-
toString
public String toString()
- Overrides:
toStringin classEnum<WeekendDefinition>
-
isWeekend
public boolean isWeekend(DayOfWeek dayOfWeek)
-
getWeekendLength
public int getWeekendLength()
-
-