Module gg.xp.xivapi

Class XivApiSettings.Builder

java.lang.Object
gg.xp.xivapi.clienttypes.XivApiSettings.Builder
Enclosing class:
XivApiSettings

public static class XivApiSettings.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setStrict

      public XivApiSettings.Builder setStrict(boolean strict)
      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

      public XivApiSettings.Builder setBaseUri(URI baseUri)
      Set the base URL. Should include the "/api/1" part of the URL.
      Parameters:
      baseUri - The new base URL
      Returns:
      The builder
    • setBaseAssetUri

      public XivApiSettings.Builder setBaseAssetUri(@Nullable @Nullable URI baseAssetUri)
      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

      public XivApiSettings.Builder setConcurrencyLimit(int concurrencyLimit)
      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

      public XivApiSettings.Builder setGameVersion(@Nullable @Nullable String gameVersion)
      Set a specific game version to use.
      Parameters:
      gameVersion - The game version to use for API requests.
      Returns:
      The builder
    • setSchemaVersion

      public XivApiSettings.Builder setSchemaVersion(@Nullable @Nullable String schemaVersion)
      Set a specific game version to use.
      Parameters:
      schemaVersion - The schema version to use for API requests.
      Returns:
      The builder
    • setUserAgent

      public XivApiSettings.Builder setUserAgent(String userAgent)
      Override the default user agent.
      Parameters:
      userAgent - The user agent string to use.
      Returns:
      The builder.
    • setAutoUnwrapValue

      public XivApiSettings.Builder setAutoUnwrapValue(boolean autoUnwrapValue)
      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

      public XivApiSettings.Builder setHttpClient(@Nullable @Nullable HttpClient httpClient)
      Set a custom HttpClient to use for API requests.
      Parameters:
      httpClient - The HttpClient to use.
      Returns:
      The builder.
    • configure

      public XivApiSettings.Builder 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.
      Parameters:
      configurer - A function that takes the builder as an argument. It should modify the builder in-place.
      Returns:
      The builder.
    • build

      public XivApiSettings build()