Package fr.marcwrobel.jbanking.calendar
Enum ShiftingStrategy
- All Implemented Interfaces:
Serializable,Comparable<ShiftingStrategy>,java.lang.constant.Constable
Holidays shifting strategies.
- Since:
- 2.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionForHolidays that are observed on the precedingDayOfWeek.FRIDAYwhen they fall onDayOfWeek.SATURDAY, or on the followingDayOfWeek.MONDAYwhen they fall onDayOfWeek.SUNDAY.ForHolidays that are observed on the followingDayOfWeek.MONDAYwhen they fall onDayOfWeek.SATURDAY, or on the followingDayOfWeek.TUESDAYwhen they fall onDayOfWeek.SUNDAY.ForHolidays that are observed on the followingDayOfWeek.MONDAYwhen they fall onDayOfWeek.SUNDAY.ForHolidays that are observed on the followingDayOfWeek.TUESDAYwhen they fall onDayOfWeek.SUNDAY.ForHolidays that are observed on the followingDayOfWeek.WEDNESDAYwhen they fall onDayOfWeek.SUNDAY.ForHolidays that are observed on the followingDayOfWeek.MONDAYwhen they fall onDayOfWeek.SATURDAYorDayOfWeek.SUNDAY. -
Method Summary
Modifier and TypeMethodDescriptionabstract LocalDateShift the given date.abstract LocalDate[]Unshift the given date.static ShiftingStrategyReturns the enum constant of this type with the specified name.static ShiftingStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CLOSEST_WEEKDAY
ForHolidays that are observed on the precedingDayOfWeek.FRIDAYwhen they fall onDayOfWeek.SATURDAY, or on the followingDayOfWeek.MONDAYwhen they fall onDayOfWeek.SUNDAY.This strategy is useful for American holidays.
-
PLUS_TWO_DAYS
ForHolidays that are observed on the followingDayOfWeek.MONDAYwhen they fall onDayOfWeek.SATURDAY, or on the followingDayOfWeek.TUESDAYwhen they fall onDayOfWeek.SUNDAY.This strategy is useful for United Kingdom holidays.
-
SUNDAY_TO_MONDAY
ForHolidays that are observed on the followingDayOfWeek.MONDAYwhen they fall onDayOfWeek.SUNDAY.This strategy is useful for US holidays.
-
SUNDAY_TO_TUESDAY
ForHolidays that are observed on the followingDayOfWeek.TUESDAYwhen they fall onDayOfWeek.SUNDAY.This strategy is useful for Japanese holidays.
-
SUNDAY_TO_WEDNESDAY
ForHolidays that are observed on the followingDayOfWeek.WEDNESDAYwhen they fall onDayOfWeek.SUNDAY.This strategy is useful for Japanese holidays.
-
WEEKEND_TO_MONDAY
ForHolidays that are observed on the followingDayOfWeek.MONDAYwhen they fall onDayOfWeek.SATURDAYorDayOfWeek.SUNDAY.This strategy is useful for Australian holidays.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
shift
Shift the given date.- Parameters:
localDate- a non-null date- Returns:
- a non-null date
- Throws:
NullPointerException- if the given date isnull
-
unshift
Unshift the given date.- Parameters:
localDate- a non-null date- Returns:
- a non-null date
- Throws:
NullPointerException- if the given date isnull
-