Package de.chojo.universalis.rest
Class UniversalisRestImpl
java.lang.Object
de.chojo.universalis.rest.UniversalisRestImpl
- All Implemented Interfaces:
UniversalisRest
Implementation of an universalis rest client
-
Constructor Summary
ConstructorsConstructorDescriptionUniversalisRestImpl(HttpClient http, ScheduledExecutorService executorService, NameSupplier itemNameSupplier) Create a new universalis rest client -
Method Summary
Modifier and TypeMethodDescriptionReturns all data centers supported by the API.extra()Allows requests on route of the extra route<T> TgetAndMap(HttpRequest request, Class<T> result) Send a request and map the result body<T> TSend a request and map the result body<T> TSend a request and map the result body<T> CompletableFuture<T>getAsyncAndMap(HttpRequest request, Class<T> result) Send an asynchronous request and map the result body<T> CompletableFuture<T>getAsyncAndMap(URI uri, Class<T> result) Send an asynchronous request to the uri and map the result body<T> CompletableFuture<T>getAsyncAndMap(org.apache.hc.core5.net.URIBuilder uri, Class<T> result) Send an asynchronous request to the uri and map the result bodyhistory()Retrieves the history data for the requested item and world or data center.http()Get the http clientReturns the set of marketable item IDs.Retrieves the data currently shown on the market board for the requested item and world or data center.com.fasterxml.jackson.databind.ObjectMapperGet the object mappertaxRates()Retrieves the current tax rate data for the specified world.org.apache.hc.core5.net.URIBuilderuri()Get a pre configured uri builderworlds()Returns the IDs and names of all worlds supported by the API.
-
Constructor Details
-
UniversalisRestImpl
public UniversalisRestImpl(HttpClient http, ScheduledExecutorService executorService, NameSupplier itemNameSupplier) Create a new universalis rest client- Parameters:
http- http clientexecutorService- executor serviceitemNameSupplier- item name supplier
-
-
Method Details
-
http
Get the http client- Returns:
- http client
-
uri
public org.apache.hc.core5.net.URIBuilder uri()Get a pre configured uri builder- Returns:
- new uri builder
-
objectMapper
public com.fasterxml.jackson.databind.ObjectMapper objectMapper()Get the object mapper- Returns:
- object mapper
-
marketBoard
Description copied from interface:UniversalisRestRetrieves the data currently shown on the market board for the requested item and world or data center.- Specified by:
marketBoardin interfaceUniversalisRest- Returns:
- request builder
-
worlds
Description copied from interface:UniversalisRestReturns the IDs and names of all worlds supported by the API.- Specified by:
worldsin interfaceUniversalisRest- Returns:
- request builder
-
dataCenters
Description copied from interface:UniversalisRestReturns all data centers supported by the API.- Specified by:
dataCentersin interfaceUniversalisRest- Returns:
- request builder
-
history
Description copied from interface:UniversalisRestRetrieves the history data for the requested item and world or data center.- Specified by:
historyin interfaceUniversalisRest- Returns:
- request builder
-
taxRates
Description copied from interface:UniversalisRestRetrieves the current tax rate data for the specified world. This data is provided by the Retainer Vocate in each major city.- Specified by:
taxRatesin interfaceUniversalisRest- Returns:
- request builder
-
marketable
Description copied from interface:UniversalisRestReturns the set of marketable item IDs.- Specified by:
marketablein interfaceUniversalisRest- Returns:
- request builder
-
extra
Description copied from interface:UniversalisRestAllows requests on route of the extra route- Specified by:
extrain interfaceUniversalisRest- Returns:
- extra route
-
getAsyncAndMap
public <T> CompletableFuture<T> getAsyncAndMap(org.apache.hc.core5.net.URIBuilder uri, Class<T> result) Send an asynchronous request to the uri and map the result body- Type Parameters:
T- result type- Parameters:
uri- uriresult- result class- Returns:
- future with result
-
getAndMap
Send a request and map the result body- Type Parameters:
T- result type- Parameters:
uri- uriresult- result class- Returns:
- result
-
getAsyncAndMap
Send an asynchronous request to the uri and map the result body- Type Parameters:
T- result type- Parameters:
uri- uriresult- result class- Returns:
- future with result
-
getAndMap
Send a request and map the result body- Type Parameters:
T- result type- Parameters:
uri- uriresult- result class- Returns:
- result
-
getAsyncAndMap
Send an asynchronous request and map the result body- Type Parameters:
T- result type- Parameters:
request- requestresult- result class- Returns:
- future with result
-
getAndMap
Send a request and map the result body- Type Parameters:
T- result type- Parameters:
request- requestresult- result class- Returns:
- result
-