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> T
getAndMap
(HttpRequest request, Class<T> result) Send a request and map the result body<T> T
Send a request and map the result body<T> T
Send 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.ObjectMapper
Get the object mappertaxRates()
Retrieves the current tax rate data for the specified world.org.apache.hc.core5.net.URIBuilder
uri()
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:UniversalisRest
Retrieves the data currently shown on the market board for the requested item and world or data center.- Specified by:
marketBoard
in interfaceUniversalisRest
- Returns:
- request builder
-
worlds
Description copied from interface:UniversalisRest
Returns the IDs and names of all worlds supported by the API.- Specified by:
worlds
in interfaceUniversalisRest
- Returns:
- request builder
-
dataCenters
Description copied from interface:UniversalisRest
Returns all data centers supported by the API.- Specified by:
dataCenters
in interfaceUniversalisRest
- Returns:
- request builder
-
history
Description copied from interface:UniversalisRest
Retrieves the history data for the requested item and world or data center.- Specified by:
history
in interfaceUniversalisRest
- Returns:
- request builder
-
taxRates
Description copied from interface:UniversalisRest
Retrieves the current tax rate data for the specified world. This data is provided by the Retainer Vocate in each major city.- Specified by:
taxRates
in interfaceUniversalisRest
- Returns:
- request builder
-
marketable
Description copied from interface:UniversalisRest
Returns the set of marketable item IDs.- Specified by:
marketable
in interfaceUniversalisRest
- Returns:
- request builder
-
extra
Description copied from interface:UniversalisRest
Allows requests on route of the extra route- Specified by:
extra
in 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
-