Interface CounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends CounterConfigurationBuilder<T,S>>
-
- All Superinterfaces:
BaseConfigurationInfo
,Builder<T>
,ConfigurationBuilderInfo
,Self<S>
- All Known Implementing Classes:
StrongCounterConfigurationBuilder
,WeakCounterConfigurationBuilder
public interface CounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends CounterConfigurationBuilder<T,S>> extends Builder<T>, Self<S>, ConfigurationBuilderInfo
Base counter configuration builder.It allows to configure the name, initial value and the
Storage
mode. The counter's name is required.- Since:
- 9.0
- Author:
- Pedro Ruivo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StrongCounterConfigurationBuilder
addStrongCounter()
WeakCounterConfigurationBuilder
addWeakCounter()
S
initialValue(long initialValue)
Sets the counter's initial value.S
name(java.lang.String name)
Sets the counter's name.S
storage(Storage mode)
Sets the counter's storage mode.-
Methods inherited from interface org.infinispan.commons.configuration.BaseConfigurationInfo
attributes, getElementDefinition
-
Methods inherited from interface org.infinispan.commons.configuration.Builder
create, read, validate
-
Methods inherited from interface org.infinispan.commons.configuration.ConfigurationBuilderInfo
getBuilderInfo, getChildrenInfo, getNewBuilderInfo
-
-
-
-
Method Detail
-
name
S name(java.lang.String name)
Sets the counter's name.This attribute is required.
- Parameters:
name
- the counter's name.
-
initialValue
S initialValue(long initialValue)
Sets the counter's initial value.Default value is zero.
- Parameters:
initialValue
- the counter's initial value.
-
storage
S storage(Storage mode)
Sets the counter's storage mode.Default value is
Storage.VOLATILE
.- Parameters:
mode
- the counter's storage mode.- See Also:
Storage
-
addStrongCounter
StrongCounterConfigurationBuilder addStrongCounter()
- Returns:
- a new builder to configure a strong counter.
-
addWeakCounter
WeakCounterConfigurationBuilder addWeakCounter()
- Returns:
- a new builder to configure a weak counter.
-
-