public class SCBClient extends AbstractContainerClient
Root client for the client hierarchy.
clientslocale, localization| Constructor and Description |
|---|
SCBClient()
Default constructor.
|
SCBClient(Locale locale)
Overloaded constructor.
|
| Modifier and Type | Method and Description |
|---|---|
EnvironmentClient |
environment()
Retrieve the client for interacting with environment data.
|
Map<String,Collection<String>> |
getInputs(String table)
Fetches all the inputs for a given table from the API.
|
String |
getRawData(String table)
Fetch the JSON response from the specified table.
|
String |
getRawData(String table,
Map<String,Collection<?>> query)
Fetch the JSON response from the specified table.
|
static boolean |
isSupportedLocale(Locale locale)
Checks if the specified
Locale is supported by the API. |
PopulationClient |
population()
Retrieve the client for interacting with population data.
|
setLocaleget, getBaseUrl, getLocale, getRegions, getUrl, getYears, post, setLocalizationLocalepublic SCBClient()
Default constructor. Initializes values and creates sub-clients.
public SCBClient(Locale locale)
Overloaded constructor.
locale - the locale for this clientpublic EnvironmentClient environment()
Retrieve the client for interacting with environment data.
public PopulationClient population()
Retrieve the client for interacting with population data.
public Map<String,Collection<String>> getInputs(String table)
Fetches all the inputs for a given table from the API.
table - the table to fetch the inputs fromJsonAPITableFormat#getInputs()public String getRawData(String table)
Fetch the JSON response from the specified table. As opposed to
getRawData(String, Map), this method fetches all available data and
therefore doesn't support selecting specific values before calling the API.
Do note: as this method matches all content codes available on the API, the response is likely to be several times larger than the response when selecting values.
table - the table to fetch data fromJsonAPITableFormat#getValues(String)public String getRawData(String table, Map<String,Collection<?>> query)
Fetch the JSON response from the specified table. Useful if you're only interested in the raw JSON data.
table - the table to fetch data fromquery - the selected valuespublic static boolean isSupportedLocale(Locale locale)
Checks if the specified Locale is supported by the API. The method
performs a request to the API using the Locale's language and checks
if a HTTP resource exists matching the language.
locale - the locale to checkCopyright © 2017. All rights reserved.