public class SCBClient extends AbstractContainerClient
Root client for the client hierarchy.
Constructor and Description |
---|
SCBClient()
Default constructor.
|
SCBClient(Locale locale)
Overloaded constructor.
|
Modifier and Type | Method and Description |
---|---|
AgricultureClient |
agriculture()
Retrieve the client for interacting with agriculture data.
|
BusinessActivitiesClient |
businessActivities()
Retrieve the client for interacting with business activities data.
|
EducationAndResearchClient |
educationAndResearch()
Retrieve the client for interacting with education and research data.
|
EnergyClient |
energy()
Retrieve the client for interacting with energy data.
|
EnvironmentClient |
environment()
Retrieve the client for interacting with environment data.
|
FinancialMarketsClient |
financialMarkets()
Retrieve the client for interacting with financial markets data.
|
Map<String,String> |
getConfig()
Fetches the config from the API.
|
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.
|
List<String> |
getRegions(String table)
Returns the list of the available regions for a given table.
|
List<String> |
getTimes(String table)
Returns the list of the available times for a given table.
|
URLEndpoint |
getUrl()
Returns the URL endpoint which this client represents.
|
GoodsAndServicesClient |
goodsAndServices()
Retrieve the client for interacting with goods and services data.
|
static boolean |
isSupportedLanguage(String language)
Checks if the specified language is supported by the API.
|
static boolean |
isSupportedLocale(Locale locale)
Checks if the specified
Locale is supported by the API. |
LabourMarketClient |
labourMarket()
Retrieve the client for interacting with labour market data.
|
LivingConditionsClient |
livingConditions()
Retrieve the client for interacting with living conditions data.
|
PopulationClient |
population()
Retrieve the client for interacting with population data.
|
PricesAndConsumptionClient |
pricesAndConsumption()
Retrieve the client for interacting with prices and consumption data.
|
PublicFinancesClient |
publicFinances()
Retrieve the client for interacting with public finances data.
|
TransportClient |
transport()
Retrieve the client for interacting with transport data.
|
addClient, getClient, setLocale
doGetRequest, doPostRequest, getLocale, getLocalizationLocale, getResponseModels, getResponseModels, getRootUrl, setLocalizationLocale
public SCBClient()
Default constructor. Initializes values and creates sub-clients.
public SCBClient(Locale locale)
Overloaded constructor.
locale
- the locale for this clientpublic AgricultureClient agriculture()
Retrieve the client for interacting with agriculture data.
public BusinessActivitiesClient businessActivities()
Retrieve the client for interacting with business activities data.
public EducationAndResearchClient educationAndResearch()
Retrieve the client for interacting with education and research data.
public EnergyClient energy()
Retrieve the client for interacting with energy data.
public EnvironmentClient environment()
Retrieve the client for interacting with environment data.
public FinancialMarketsClient financialMarkets()
Retrieve the client for interacting with financial markets data.
public GoodsAndServicesClient goodsAndServices()
Retrieve the client for interacting with goods and services data.
public LabourMarketClient labourMarket()
Retrieve the client for interacting with labour market data.
public LivingConditionsClient livingConditions()
Retrieve the client for interacting with living conditions data.
public PopulationClient population()
Retrieve the client for interacting with population data.
public PricesAndConsumptionClient pricesAndConsumption()
Retrieve the client for interacting with prices and consumption data.
public PublicFinancesClient publicFinances()
Retrieve the client for interacting with public finances data.
public TransportClient transport()
Retrieve the client for interacting with transport 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#getPairs()
public List<String> getRegions(String table)
Returns the list of the available regions for a given table.
table
- the table to retrieve the regions frompublic List<String> getTimes(String table)
Returns the list of the available times for a given table.
table
- the table to retrieve the times frompublic 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 Map<String,String> getConfig()
Fetches the config from the API. Useful if you for example need to know how often you're allowed to make calls to the API, or the max size of the response.
public static boolean isSupportedLanguage(String language)
Checks if the specified language is supported by the API. See
isSupportedLocale(Locale)
for implementation details.
language
- the language to checkpublic 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 checkLocale
is supported, otherwise falsepublic URLEndpoint getUrl()
AbstractClient
Returns the URL endpoint which this client represents.
getUrl
in class AbstractClient
Copyright © 2018. All rights reserved.