java.lang.Object
gg.xp.xivapi.clienttypes.XivApiSettings.Builder
- Enclosing class:
XivApiSettings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()configure(Consumer<XivApiSettings.Builder> configurer) Method that allows you to supply configurations to the builder in a re-usable manner, without breaking the builder pattern by passing the builder into another method.setAutoUnwrapValue(boolean autoUnwrapValue) Set whether the client will detect and unwrap values of the form{"value":actualValue}.setBaseAssetUri(@Nullable URI baseAssetUri) Set an alternative base URL for assets.setBaseUri(URI baseUri) Set the base URL.setConcurrencyLimit(int concurrencyLimit) Set a concurrency limit for API requests.setGameVersion(@Nullable String gameVersion) Set a specific game version to use.setHttpClient(@Nullable HttpClient httpClient) Set a custom HttpClient to use for API requests.setSchemaVersion(@Nullable String schemaVersion) Set a specific game version to use.setStrict(boolean strict) Enable stricter handling of null/undefined/missing/zero values.setUserAgent(String userAgent) Override the default user agent.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setStrict
Enable stricter handling of null/undefined/missing/zero values. Defaults to true. Disabling this will cause null (for objects) or zero/false (for primitives) to be returned instead of throwing an exception in most circumstances.- Parameters:
strict- Whether to enable strict mode.- Returns:
- The builder
-
setBaseUri
Set the base URL. Should include the "/api/1" part of the URL.- Parameters:
baseUri- The new base URL- Returns:
- The builder
-
setBaseAssetUri
Set an alternative base URL for assets. Should include the "/api/1" part of the URL.- Parameters:
baseAssetUri- The new base URL- Returns:
- The builder
-
setConcurrencyLimit
Set a concurrency limit for API requests. Defaults to 10. Modify responsibly. Don't tip over Xivapi, but if you're using your own Boilmaster instance, go wild.- Parameters:
concurrencyLimit- Concurrency limit override.- Returns:
- The builder
-
setGameVersion
Set a specific game version to use.- Parameters:
gameVersion- The game version to use for API requests.- Returns:
- The builder
-
setSchemaVersion
Set a specific game version to use.- Parameters:
schemaVersion- The schema version to use for API requests.- Returns:
- The builder
-
setUserAgent
Override the default user agent.- Parameters:
userAgent- The user agent string to use.- Returns:
- The builder.
-
setAutoUnwrapValue
Set whether the client will detect and unwrap values of the form{"value":actualValue}. Defaults to true. If set to false, then those will instead throw an exception, and you will need to instead use a XivApiStruct type to deserialize that value.- Parameters:
autoUnwrapValue- Whether to automatically unwrap wrapped values.- Returns:
- The builder.
-
setHttpClient
Set a custom HttpClient to use for API requests.- Parameters:
httpClient- The HttpClient to use.- Returns:
- The builder.
-
configure
Method that allows you to supply configurations to the builder in a re-usable manner, without breaking the builder pattern by passing the builder into another method.- Parameters:
configurer- A function that takes the builder as an argument. It should modify the builder in-place.- Returns:
- The builder.
-
build
-