Class UniversalisRestBuilder
java.lang.Object
de.chojo.universalis.rest.UniversalisRestBuilder
Class to build an universalis rest client
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the api.setBaseUri(URI baseUri) Override the base URI of the universalis API.setExecutorService(ScheduledExecutorService executorService) Set the executor service used for asynchronous requests.setHttp(HttpClient http) Set the http client used to send requests to universalissetItemNameSupplier(NameSupplier nameSupplier) Set the item name supplier.
-
Field Details
-
DEFAULT_BASE_URI
Default base URI of the universalis API.
-
-
Constructor Details
-
UniversalisRestBuilder
public UniversalisRestBuilder()
-
-
Method Details
-
setHttp
Set the http client used to send requests to universalis- Parameters:
http- client- Returns:
- builder
-
setExecutorService
@CheckReturnValue public UniversalisRestBuilder setExecutorService(ScheduledExecutorService executorService) Set the executor service used for asynchronous requests.- Parameters:
executorService- executor service- Returns:
- builder
-
setItemNameSupplier
Set the item name supplier. This is required to get item names on runtime. UseItems.create()to get a default implementation using a fallback file.- Parameters:
nameSupplier- name supplier- Returns:
- builder
-
setBaseUri
Override the base URI of the universalis API. Defaults toDEFAULT_BASE_URI.- Parameters:
baseUri- base URI- Returns:
- builder
-
build
Build the api. The instance is ready to use.- Returns:
- api instance
-