public class GoogleCalendarAPI extends Object implements HolidaySearcher
app.pickmaven.businessdays.HolidaySearcher interface for getting a list of LocalDate objects representing
the holidays for specific countries using the app.pickmaven.businessdays.GoogleCalendarAPI of Google.
This class is immutable and thread-safe.
| Constructor and Description |
|---|
GoogleCalendarAPI(String token_path)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
GoogleCalendarAPI |
applyPredicate(java.util.function.Predicate<? super com.google.api.services.calendar.model.Event> predicate)
Apply the {@code Predicate
|
List<java.time.LocalDate> |
searchHolidaysFor(String countryCode)
Returns a list of
LocalDate objects representing the holidays for a specific country. |
public GoogleCalendarAPI(String token_path)
token_path - the token path of json filepublic GoogleCalendarAPI applyPredicate(java.util.function.Predicate<? super com.google.api.services.calendar.model.Event> predicate)
Predicate<? super Event in order to filter the holidays.predicate - to apply in order to filter the holidays given as response from the Google Calendar Apipublic List<java.time.LocalDate> searchHolidaysFor(String countryCode) throws IOException, GeneralSecurityException
LocalDate objects representing the holidays for a specific country.searchHolidaysFor in interface HolidaySearchercountryCode - for which return holidaysIOExceptionGeneralSecurityExceptionCopyright © 2020. All rights reserved.