Class StrongCounterConfigurationBuilder
- java.lang.Object
-
- org.infinispan.counter.configuration.StrongCounterConfigurationBuilder
-
- All Implemented Interfaces:
BaseConfigurationInfo
,Builder<StrongCounterConfiguration>
,ConfigurationBuilderInfo
,Self<StrongCounterConfigurationBuilder>
,CounterConfigurationBuilder<StrongCounterConfiguration,StrongCounterConfigurationBuilder>
public class StrongCounterConfigurationBuilder extends java.lang.Object
StrongCounter
configuration builder.- Since:
- 9.0
- Author:
- Pedro Ruivo
-
-
Constructor Summary
Constructors Constructor Description StrongCounterConfigurationBuilder(CounterManagerConfigurationBuilder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StrongCounterConfigurationBuilder
addStrongCounter()
WeakCounterConfigurationBuilder
addWeakCounter()
AttributeSet
attributes()
StrongCounterConfiguration
create()
Create the configuration beanElementDefinition
getElementDefinition()
S
initialValue(long initialValue)
Sets the counter's initial value.StrongCounterConfigurationBuilder
lowerBound(long value)
Sets the lower bound (inclusive) of the counter if a bounded counter is desired.java.lang.String
name()
S
name(java.lang.String name)
Sets the counter's name.Builder<?>
read(StrongCounterConfiguration template)
Reads the configuration from an already created configuration bean into this builder.StrongCounterConfigurationBuilder
self()
S
storage(Storage mode)
Sets the counter's storage mode.StrongCounterConfigurationBuilder
upperBound(long value)
Sets the upper bound (inclusive) of the counter if a bounded counter is desired.void
validate()
Validate the data in this builder before building the configuration bean-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.commons.configuration.ConfigurationBuilderInfo
getBuilderInfo, getChildrenInfo, getNewBuilderInfo
-
-
-
-
Constructor Detail
-
StrongCounterConfigurationBuilder
public StrongCounterConfigurationBuilder(CounterManagerConfigurationBuilder builder)
-
-
Method Detail
-
attributes
public AttributeSet attributes()
- Returns:
- the
AttributeSet
declared by the configuration.
-
getElementDefinition
public ElementDefinition getElementDefinition()
- Returns:
- the
ElementDefinition
of the configuration.
-
upperBound
public StrongCounterConfigurationBuilder upperBound(long value)
Sets the upper bound (inclusive) of the counter if a bounded counter is desired.Default value is
Long.MAX_VALUE
.- Parameters:
value
- the new counter's upper bound.
-
lowerBound
public StrongCounterConfigurationBuilder lowerBound(long value)
Sets the lower bound (inclusive) of the counter if a bounded counter is desired.Default value is
Long.MIN_VALUE
.- Parameters:
value
- the new counter's lower bound.
-
create
public StrongCounterConfiguration create()
Description copied from interface:Builder
Create the configuration bean- Returns:
-
read
public Builder<?> read(StrongCounterConfiguration template)
Description copied from interface:Builder
Reads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Parameters:
template
- the configuration from which to "clone" this config if needed.
-
self
public StrongCounterConfigurationBuilder self()
-
validate
public void validate()
Description copied from interface:Builder
Validate the data in this builder before building the configuration bean- Specified by:
validate
in interfaceBuilder<StrongCounterConfiguration>
-
name
public final S name(java.lang.String name)
Description copied from interface:CounterConfigurationBuilder
Sets the counter's name.This attribute is required.
- Specified by:
name
in interfaceCounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T,S>>
- Parameters:
name
- the counter's name.
-
initialValue
public final S initialValue(long initialValue)
Description copied from interface:CounterConfigurationBuilder
Sets the counter's initial value.Default value is zero.
- Specified by:
initialValue
in interfaceCounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T,S>>
- Parameters:
initialValue
- the counter's initial value.
-
storage
public final S storage(Storage mode)
Description copied from interface:CounterConfigurationBuilder
Sets the counter's storage mode.Default value is
Storage.VOLATILE
.- Specified by:
storage
in interfaceCounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T,S>>
- Parameters:
mode
- the counter's storage mode.- See Also:
Storage
-
name
public java.lang.String name()
-
addStrongCounter
public StrongCounterConfigurationBuilder addStrongCounter()
- Specified by:
addStrongCounter
in interfaceCounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T,S>>
- Returns:
- a new builder to configure a strong counter.
-
addWeakCounter
public WeakCounterConfigurationBuilder addWeakCounter()
- Specified by:
addWeakCounter
in interfaceCounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T,S>>
- Returns:
- a new builder to configure a weak counter.
-
-