Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated 'getHolidays(int year, ...)' method #684

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,6 @@ public ManagerParameter getManagerParameter() {
return managerParameter;
}

/**
* Returns the holidays for the requested year and hierarchy structure.
*
* @param year i.e. 2010
* @param args i.e. args = {'ny'}. returns US/New York holidays. No args means holidays common to whole country
* @return a set of holidays for the requested year
*
* @deprecated in favor of <code>getHolidays(final Year year, final String... args)</code>
*/
@Deprecated(forRemoval = true, since = "0.31.0")
public abstract Set<Holiday> getHolidays(final int year, final String... args);

/**
* Returns the holidays for the requested year and hierarchy structure.
*
Expand All @@ -275,19 +263,6 @@ public ManagerParameter getManagerParameter() {
*/
public abstract Set<Holiday> getHolidays(final Year year, final String... args);

/**
* Returns the holidays for the requested year, the given {@link HolidayType} and the hierarchy structure
*
* @param year i.e. 2010
* @param holidayType a {@link HolidayType} to be considered
* @param args i.e. args = {'ny'}. returns US/New York holidays. No args means holidays common to whole country
* @return a set of holidays of the given {@link HolidayType} for the requested year
*
* @deprecated in favor of <code>getHolidays(final Year year, final HolidayType holidayType, final String... args);</code>
*/
@Deprecated(forRemoval = true, since = "0.31.0")
public abstract Set<Holiday> getHolidays(final int year, final HolidayType holidayType, final String... args);

/**
* Returns the holidays for the requested year, the given {@link HolidayType} and the hierarchy structure
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,6 @@ public void doInit() {
logHierarchy(configuration, 0);
}

/**
* {@inheritDoc}
* <p>
* Calls
* <code>Set&lt;LocalDate&gt; getHolidays(Year year, Configuration c, String... args)</code>
* with the configuration from initialization.
*/
@Override
public Set<Holiday> getHolidays(final int year, final String... args) {
return getHolidays(Year.of(year), args);
}

/**
* {@inheritDoc}
* <p>
Expand Down Expand Up @@ -126,14 +114,6 @@ public Set<Holiday> createValue() {
return holidayCache.get(holidayValueHandler);
}

/**
* {@inheritDoc}
*/
@Override
public Set<Holiday> getHolidays(final int year, final HolidayType holidayType, final String... args) {
return getHolidays(Year.of(year), holidayType, args);
}

/**
* {@inheritDoc}
*/
Expand All @@ -157,7 +137,8 @@ public Set<Holiday> getHolidays(final LocalDate startDateInclusive, final LocalD
Objects.requireNonNull(endDateInclusive, "endDateInclusive is null");

return rangeClosed(startDateInclusive.getYear(), endDateInclusive.getYear())
.mapToObj(year -> getHolidays(year, args))
.mapToObj(Year::of)
.map(year -> getHolidays(year, args))
.flatMap(Collection::stream)
.filter(holiday -> !startDateInclusive.isAfter(holiday.getDate()) && !endDateInclusive.isBefore(holiday.getDate()))
.collect(toUnmodifiableSet());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@ public class JapaneseHolidayManager extends DefaultHolidayManager {
*/
private static final String BRIDGING_HOLIDAY_PROPERTIES_KEY = "BRIDGING_HOLIDAY";

/**
* {@inheritDoc}
* <p>
* Implements the rule which requests if two holidays have one non holiday
* between each other than this day is also a holiday.
*
* @deprecated in favor of <code>getHolidays(final Year year, final String... args)</code>
*/
@Deprecated(forRemoval = true, since = "0.31.0")
@Override
public Set<Holiday> getHolidays(final int year, final String... args) {
return getHolidays(Year.of(year), args);
}

/**
* {@inheritDoc}
* <p>
Expand Down
Loading