public class HolidayAPIConsumer extends Object implements APIConsumer
APIConsumer.| Constructor and Description |
|---|
HolidayAPIConsumer(String baseURl)
Parameterized constructor
|
| Modifier and Type | Method and Description |
|---|---|
HolidayAPIResponse |
getHolidays(QueryParams queryParams)
Call the holidays api and send back the response encapsulatd in a
HolidayAPIResponse object. |
String |
getHolidaysAsString(QueryParams queryParams)
Call the holidays api and send back the response as a json string
|
public HolidayAPIConsumer(String baseURl)
baseURl - - the base url of the APIpublic HolidayAPIResponse getHolidays(QueryParams queryParams) throws IOException
HolidayAPIResponse object.
This is a wrapper method that depends on getHolidaysAsString(QueryParams)
to get the json string and then map it to a java objectgetHolidays in interface APIConsumerqueryParams - - the params encapsulated in an objectIOException - - when there are connection issues or the URL is malformedpublic String getHolidaysAsString(QueryParams queryParams) throws IOException
getHolidaysAsString in interface APIConsumerqueryParams - - the params encapsulated in an objectIOException - - when there are connection issues or the URL is malformedCopyright © 2020. All rights reserved.