Package com.github.gpluscb.ggjava.api
Class GGClient.Builder
- java.lang.Object
-
- com.github.gpluscb.ggjava.api.GGClient.Builder
-
- Enclosing interface:
- GGClient
public static class GGClient.Builder extends java.lang.Object
Used for building instances of GGClient.- See Also:
GGClient.builder(java.lang.String)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GGClient
build()
Builds the GGClient instance.GGClient.Builder
client(okhttp3.OkHttpClient client)
Sets the OkHttpClient used to make requests.GGClient.Builder
limiter(RateLimiter limiter)
Sets the RateLimiter used to schedule requests.GGClient.Builder
maxRetries(java.lang.Integer maxRetries)
Sets the maximum number of retries for one request.
-
-
-
Method Detail
-
client
@Nonnull public GGClient.Builder client(@Nullable okhttp3.OkHttpClient client)
Sets the OkHttpClient used to make requests.- Parameters:
client
- the OkHttpClient to use or null- Returns:
- itself for chaining
-
limiter
@Nonnull public GGClient.Builder limiter(@Nullable RateLimiter limiter)
Sets the RateLimiter used to schedule requests.- Parameters:
limiter
- the RateLimiter to use or null- Returns:
- itself for chaining
-
maxRetries
@Nonnull public GGClient.Builder maxRetries(@Nonnegative @Nullable java.lang.Integer maxRetries)
Sets the maximum number of retries for one request.- Parameters:
maxRetries
- the maximum amount of retriest for one request to use or null- Returns:
- itself for chaining
-
build
@Nonnull public GGClient build()
Builds the GGClient instance.- Returns:
- the GGClient instance
-
-