public class BusinessDay extends Object
app.pickmaven.businessdays.BusinessDay stores an app.pickmaven.businessdays.Holidays object. It offers different construction methods for setting up some
configurations such as the weekdays that will be treated as holidays or also the temporal range to which the calculation is applied.
This class is immutable and thread-safe.
| Modifier and Type | Class and Description |
|---|---|
static class |
BusinessDay.Builder
Public builder for creating instances of
app.pickmaven.businessdays.BusinessDay objects. |
| Modifier and Type | Method and Description |
|---|---|
Date |
asDate() |
String |
asDateTimeDuration(String... hoursMinutesCommaSeparated)
Prints the duration between current date and the next business day as a string in format 'PnDTnHnMnS'.
|
java.time.Duration |
asDuration(String... hoursMinutesCommaSeparated)
Prints the
Duration between current date and the next business day. |
java.time.LocalDate |
asLocalDate() |
Long |
asLong(int... hoursMinutesSecondsCommaSeparated)
Return next business day as long value given hours, minutes and seconds to add.
|
java.time.Period |
asPeriod() |
String |
asString(java.time.format.DateTimeFormatter formatter)
Outputs the date as string given a
DateTimeFormatte. |
String |
asString(String pattern)
Outputs the date as string given a string formatter.
|
Holidays |
getHolidays(Integer... years)
Gets the
app.pickmaven.businessdays.Holidays object; this method gives you the possibility to filter the holidays based on years
you pass as integers. |
Holidays |
getHolidaysForTemporalRange(TemporalRange range)
Gets the
app.pickmaven.businessdays.Holidays object filtered based temporal range you pass as parameter. |
Holidays |
getHolidaysFromNow(Integer... years)
Gets the
app.pickmaven.businessdays.Holidays object starting from current date; this method gives you the possibility to filter the holidays based on years
you pass as integers. |
Holidays |
getHolidaysFromStartingDate(Integer... years)
Gets the
app.pickmaven.businessdays.Holidays object starting from starting date; this method gives you the possibility to filter the holidays based on years
you pass as integers. |
BusinessDay |
nextBusinessDay()
Computes the next business day based on certain conditions.
|
BusinessDay |
nextBusinessDay(int workDays)
Computes the next business day based on certain conditions adding a specific number of workdays.
|
public BusinessDay nextBusinessDay()
This method checks if starting date is not a business saturday or sunday, is not an holiday weekday or an holiday adding a day to the starting one only if theese conditions are met.
public BusinessDay nextBusinessDay(int workDays)
This method checks if starting date is not a business saturday or sunday, is not an holiday weekday or an holiday adding days to the starting one only if theese conditions are met.
workDays - the number to add from starting datepublic java.time.LocalDate asLocalDate()
LocalDatepublic Date asDate()
Datepublic Long asLong(int... hoursMinutesSecondsCommaSeparated)
hoursMinutesSecondsCommaSeparated - hours, minutes and seconds comma separated; default '0'public String asString(java.time.format.DateTimeFormatter formatter)
DateTimeFormatte.formatter - DateTimeFormatter pattern object for formatting the stringpublic String asString(String pattern)
pattern - pattern for formatting the stringpublic java.time.Period asPeriod()
Periodpublic java.time.Duration asDuration(String... hoursMinutesCommaSeparated)
Duration between current date and the next business day.hoursMinutesCommaSeparated - hours and minutes comma separated, default '00'Durationpublic String asDateTimeDuration(String... hoursMinutesCommaSeparated)
hoursMinutesCommaSeparated - hours and minutes comma separated, default '00'Stringpublic Holidays getHolidays(Integer... years)
app.pickmaven.businessdays.Holidays object; this method gives you the possibility to filter the holidays based on years
you pass as integers.years - Integer[] years for filtering the holidays in app.pickmaven.businessdays.Holidays objectapp.pickmaven.businessdays.Holidayspublic Holidays getHolidaysFromNow(Integer... years)
app.pickmaven.businessdays.Holidays object starting from current date; this method gives you the possibility to filter the holidays based on years
you pass as integers.years - Integer[] years for filtering the holidays in app.pickmaven.businessdays.Holidays objectapp.pickmaven.businessdays.Holidayspublic Holidays getHolidaysFromStartingDate(Integer... years)
app.pickmaven.businessdays.Holidays object starting from starting date; this method gives you the possibility to filter the holidays based on years
you pass as integers.years - Integer[] years for filtering the holidays in app.pickmaven.businessdays.Holidays objectapp.pickmaven.businessdays.Holidayspublic Holidays getHolidaysForTemporalRange(TemporalRange range)
app.pickmaven.businessdays.Holidays object filtered based temporal range you pass as parameter.range - app.pickmaven.businessdays.TemporalRange range for filtering the holidays in app.pickmaven.businessdays.Holidays objectapp.pickmaven.businessdays.HolidaysCopyright © 2020. All rights reserved.