T - distributed primitive typepublic abstract class DistributedPrimitiveBuilder<B extends DistributedPrimitiveBuilder<B,T>,T extends DistributedPrimitive> extends Object
| Constructor and Description |
|---|
DistributedPrimitiveBuilder(DistributedPrimitive.Type type) |
| Modifier and Type | Method and Description |
|---|---|
ApplicationId |
applicationId()
Returns the application identifier.
|
abstract T |
build()
Constructs an instance of the distributed primitive.
|
Supplier<Executor> |
executorSupplier()
Returns the executor supplier.
|
boolean |
meteringEnabled()
Returns if metering is enabled.
|
String |
name()
Returns the name of the primitive.
|
boolean |
partitionsDisabled()
Returns if partitions are disabled.
|
boolean |
readOnly()
Returns if updates are disabled.
|
boolean |
relaxedReadConsistency()
Returns if consistency is relaxed for read operations.
|
Serializer |
serializer()
Returns the serializer.
|
DistributedPrimitive.Type |
type()
Returns the primitive type.
|
B |
withApplicationId(ApplicationId applicationId)
Sets the application id that owns this primitive.
|
B |
withExecutor(Executor executor)
Sets the executor to use for asynchronous callbacks.
|
B |
withExecutorSupplier(Supplier<Executor> executorSupplier)
Sets the supplier to be used to create executors.
|
B |
withMeteringDisabled()
Deprecated.
usage of this method is discouraged for most common scenarios.
|
B |
withName(String name)
Sets the primitive name.
|
B |
withRelaxedReadConsistency()
Turns on relaxed consistency for read operations.
|
B |
withSerializer(Serializer serializer)
Sets the serializer to use for transcoding info held in the primitive.
|
B |
withUpdatesDisabled()
Disables state changing operations on the returned distributed primitive.
|
public DistributedPrimitiveBuilder(DistributedPrimitive.Type type)
public B withName(String name)
name - primitive namepublic B withSerializer(Serializer serializer)
serializer - serializerpublic B withExecutor(Executor executor)
For partitioned primitives, the provided executor will be shared across all partitions.
executor - the executor to use for asynchronous callbackspublic B withExecutorSupplier(Supplier<Executor> executorSupplier)
When a factory is set, the supplier will be used to create a separate executor for each partition.
executorSupplier - the executor supplierpublic B withApplicationId(ApplicationId applicationId)
applicationId - application identifier@Deprecated public B withMeteringDisabled()
public B withUpdatesDisabled()
public B withRelaxedReadConsistency()
public final boolean meteringEnabled()
true if yes; false otherwisepublic final boolean partitionsDisabled()
true if yes; false otherwisepublic final boolean readOnly()
true if yes; false otherwisepublic final boolean relaxedReadConsistency()
true if yes; false otherwisepublic final Serializer serializer()
public final Supplier<Executor> executorSupplier()
public final ApplicationId applicationId()
public final String name()
public final DistributedPrimitive.Type type()
public abstract T build()