public class Holiday extends Object
app.pickmaven.businessdays.Holiday is an immutable object that wraps a date as a LocalDate object.
This class is immutable and thread-safe
| Modifier and Type | Field and Description |
|---|---|
static Holiday |
CHRISTMAS
The
app.pickmaven.businessdays.Holiday represented by Christmas day. |
static Holiday |
EASTER
The
app.pickmaven.businessdays.Holiday represented by Easter. |
static Holiday |
EASTER_MONDAY
The
app.pickmaven.businessdays.Holiday represented by Easter Monday. |
static Holiday |
HOLIDAY_NOW
The
app.pickmaven.businessdays.Holiday represented by today. |
| Constructor and Description |
|---|
Holiday(Date date)
Create an holiday from a
Date object. |
Holiday(java.time.LocalDate date)
Create an holiday from a
LocalDate object. |
Holiday(java.time.MonthDay date)
Create an holiday from a
MonthDay object assuming the year as the current one. |
Holiday(String date,
java.time.format.DateTimeFormatter formatter)
Create an holiday from a
String object representing the date and a DateTimeFormatter. |
Holiday(String date,
SimpleDateFormat formatter)
Create an holiday from a
String object representing the date and a SimpleDateFormat object. |
Holiday(String date,
String formatter)
Create an holiday from a
String object representing the date and a String representing the formatter pattern. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Check if this holiday date is equal to another holiday date.
|
java.time.LocalDate |
getDate()
Gets the holiday date.
|
int |
getDay()
Gets the day of holiday.
|
static Holiday |
getEasterMonday(int year)
Return an instance of
app.pickmaven.businessdays.Holiday from the Easter Monday date for the specified year. |
int |
getMonth()
Gets the month of holiday.
|
int |
getYear()
Gets the year of holiday.
|
int |
hashCode()
A hash code for this holiday date.
|
static Holiday |
of(int year,
int month,
int day)
Return instance of
app.pickmaven.businessdays.Holiday from year, month and day. |
static Holiday |
today()
Return instance of @code app.pickmaven.businessdays.Holiday} with the current date.
|
String |
toString()
Outputs the holiday date as date.
|
public static final Holiday HOLIDAY_NOW
app.pickmaven.businessdays.Holiday represented by today.public static final Holiday EASTER
app.pickmaven.businessdays.Holiday represented by Easter.public static final Holiday EASTER_MONDAY
app.pickmaven.businessdays.Holiday represented by Easter Monday.public static final Holiday CHRISTMAS
app.pickmaven.businessdays.Holiday represented by Christmas day.public Holiday(java.time.LocalDate date)
LocalDate object.date - public Holiday(String date, java.time.format.DateTimeFormatter formatter)
String object representing the date and a DateTimeFormatter.date - formatter - public Holiday(String date, String formatter)
String object representing the date and a String representing the formatter pattern.date - formatter - public Holiday(String date, SimpleDateFormat formatter)
String object representing the date and a SimpleDateFormat object.date - formatter - public Holiday(Date date)
Date object.date - public Holiday(java.time.MonthDay date)
MonthDay object assuming the year as the current one.date - public static Holiday today()
Holiday todaypublic static Holiday of(int year, int month, int day)
app.pickmaven.businessdays.Holiday from year, month and day.year - of Holidaymonth - of Holidayday - of HolidayHolidaypublic static Holiday getEasterMonday(int year)
app.pickmaven.businessdays.Holiday from the Easter Monday date for the specified year.year - for which computing Easter MondayHolidaypublic java.time.LocalDate getDate()
LocalDatepublic int getYear()
public int getMonth()
public int getDay()
public boolean equals(Object o)
public int hashCode()
Copyright © 2020. All rights reserved.