Package org.onosproject.store.primitives
Class DistributedPrimitiveOptions<O extends DistributedPrimitiveOptions<O>>
- java.lang.Object
-
- org.onosproject.store.primitives.DistributedPrimitiveOptions<O>
-
- Type Parameters:
O
- distributed primitive options type
- Direct Known Subclasses:
AtomicCounterMapOptions
,AtomicCounterOptions
,AtomicIdGeneratorOptions
,AtomicValueOptions
,ConsistentMapOptions
,ConsistentMultimapOptions
,ConsistentTreeMapOptions
,DistributedLockOptions
,DistributedSetOptions
,DocumentTreeOptions
,LeaderElectorOptions
,TopicOptions
,TransactionContextOptions
,WorkQueueOptions
public abstract class DistributedPrimitiveOptions<O extends DistributedPrimitiveOptions<O>> extends Object
Abstract builder for distributed primitives.
-
-
Constructor Summary
Constructors Constructor Description DistributedPrimitiveOptions(DistributedPrimitive.Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApplicationId
applicationId()
Returns the application identifier.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.RevisionType
revisionType()
Returns the primitive revision type.Serializer
serializer()
Returns the serializer.DistributedPrimitive.Type
type()
Returns the primitive type.Version
version()
Returns the primitive version.O
withApplicationId(ApplicationId applicationId)
Sets the application id that owns this primitive.O
withName(String name)
Sets the primitive name.O
withRelaxedReadConsistency()
Turns on relaxed consistency for read operations.O
withRevisionType(RevisionType revisionType)
Sets the primitive revision type.O
withSerializer(Serializer serializer)
Sets the serializer to use for transcoding info held in the primitive.O
withUpdatesDisabled()
Disables state changing operations on the returned distributed primitive.O
withVersion(Version version)
Sets the primitive version.
-
-
-
Constructor Detail
-
DistributedPrimitiveOptions
public DistributedPrimitiveOptions(DistributedPrimitive.Type type)
-
-
Method Detail
-
withName
public O withName(String name)
Sets the primitive name.- Parameters:
name
- primitive name- Returns:
- this builder
-
withSerializer
public O withSerializer(Serializer serializer)
Sets the serializer to use for transcoding info held in the primitive.- Parameters:
serializer
- serializer- Returns:
- this builder
-
withApplicationId
public O withApplicationId(ApplicationId applicationId)
Sets the application id that owns this primitive.- Parameters:
applicationId
- application identifier- Returns:
- this builder
-
withVersion
public O withVersion(Version version)
Sets the primitive version.- Parameters:
version
- the primitive version- Returns:
- this builder
-
withRevisionType
public O withRevisionType(RevisionType revisionType)
Sets the primitive revision type.- Parameters:
revisionType
- the revision type- Returns:
- this builder
-
withUpdatesDisabled
public O withUpdatesDisabled()
Disables state changing operations on the returned distributed primitive.- Returns:
- this builder
-
withRelaxedReadConsistency
public O withRelaxedReadConsistency()
Turns on relaxed consistency for read operations.- Returns:
- this builder
-
meteringEnabled
public final boolean meteringEnabled()
Returns if metering is enabled.- Returns:
true
if yes;false
otherwise
-
partitionsDisabled
public final boolean partitionsDisabled()
Returns if partitions are disabled.- Returns:
true
if yes;false
otherwise
-
readOnly
public final boolean readOnly()
Returns if updates are disabled.- Returns:
true
if yes;false
otherwise
-
relaxedReadConsistency
public final boolean relaxedReadConsistency()
Returns if consistency is relaxed for read operations.- Returns:
true
if yes;false
otherwise
-
serializer
public final Serializer serializer()
Returns the serializer.- Returns:
- serializer
-
applicationId
public final ApplicationId applicationId()
Returns the application identifier.- Returns:
- application id
-
name
public final String name()
Returns the name of the primitive.- Returns:
- primitive name
-
type
public final DistributedPrimitive.Type type()
Returns the primitive type.- Returns:
- primitive type
-
version
public final Version version()
Returns the primitive version.- Returns:
- the primitive version
-
revisionType
public RevisionType revisionType()
Returns the primitive revision type.- Returns:
- the primitive revision type
-
-