public final class CustomObjectBigIntegerNumberGeneratorConfigBuilder extends Base implements Builder<CustomObjectBigIntegerNumberGeneratorConfig>
CustomObjectBigIntegerNumberGeneratorConfig
instances using the Builder pattern.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CONTAINER |
static int |
DEFAULT_RETRY_ATTEMPTS |
Modifier and Type | Method and Description |
---|---|
CustomObjectBigIntegerNumberGeneratorConfig |
build()
Creates a new instance of T with the values of this builder.
|
CustomObjectBigIntegerNumberGeneratorConfigBuilder |
container(String container)
Sets the container for the
CustomObject storing the last used sequence number. |
CustomObjectBigIntegerNumberGeneratorConfigBuilder |
initialValue(BigInteger initialValue)
Sets the first number generated if the underlying
CustomObject does not exist. |
CustomObjectBigIntegerNumberGeneratorConfigBuilder |
maxRetryAttempts(int maxRetryAttempts)
Sets the maximum amount of retries.
|
static CustomObjectBigIntegerNumberGeneratorConfigBuilder |
of(SphereClient sphereClient,
String key)
Creates a new builder instance.
|
public static final int DEFAULT_RETRY_ATTEMPTS
public static final String DEFAULT_CONTAINER
public CustomObjectBigIntegerNumberGeneratorConfigBuilder container(String container)
CustomObject
storing the last used sequence number.container
- container name of the underlying CustomObject
. If this method is not used the default value is "io.sphere.sdk.sequencegenerators".public CustomObjectBigIntegerNumberGeneratorConfigBuilder maxRetryAttempts(int maxRetryAttempts)
maxRetryAttempts
- the maximum amount of attempts to retry the number generation if a ConcurrentModificationException
occurs
By default it is set to 100.public CustomObjectBigIntegerNumberGeneratorConfigBuilder initialValue(BigInteger initialValue)
CustomObject
does not exist.initialValue
- first number generated. By default it is set to 1.public static CustomObjectBigIntegerNumberGeneratorConfigBuilder of(SphereClient sphereClient, String key)
sphereClient
- A client to perform requests to the Composable Commerce APIs.key
- the key is part of the namespace to store the CustomObject
with the last used sequence number, it normally is sth. like "orderNumber" or "customerNumber"CustomObject
public CustomObjectBigIntegerNumberGeneratorConfig build()
Builder
build
in interface Builder<CustomObjectBigIntegerNumberGeneratorConfig>