Class StrongCounterConfigurationBuilder
- java.lang.Object
-
- org.infinispan.counter.configuration.StrongCounterConfigurationBuilder
-
- All Implemented Interfaces:
Builder<StrongCounterConfiguration>,Self<StrongCounterConfigurationBuilder>,CounterConfigurationBuilder<StrongCounterConfiguration,StrongCounterConfigurationBuilder>
public class StrongCounterConfigurationBuilder extends Object
StrongCounterconfiguration builder.- Since:
- 9.0
- Author:
- Pedro Ruivo
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StrongCounterConfigurationBuilderaddStrongCounter()WeakCounterConfigurationBuilderaddWeakCounter()StrongCounterConfigurationcreate()Create the configuration beanSinitialValue(long initialValue)Sets the counter's initial value.StrongCounterConfigurationBuilderlowerBound(long value)Sets the lower bound (inclusive) of the counter if a bounded counter is desired.Stringname()Sname(String name)Sets the counter's name.Builder<?>read(StrongCounterConfiguration template)Reads the configuration from an already created configuration bean into this builder.StrongCounterConfigurationBuilderself()Sstorage(Storage mode)Sets the counter's storage mode.StrongCounterConfigurationBuilderupperBound(long value)Sets the upper bound (inclusive) of the counter if a bounded counter is desired.voidvalidate()Validate the data in this builder before building the configuration bean
-
-
-
Method Detail
-
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:BuilderCreate the configuration bean- Returns:
-
read
public Builder<?> read(StrongCounterConfiguration template)
Description copied from interface:BuilderReads 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:BuilderValidate the data in this builder before building the configuration bean- Specified by:
validatein interfaceBuilder<StrongCounterConfiguration>
-
name
public final S name(String name)
Description copied from interface:CounterConfigurationBuilderSets the counter's name.This attribute is required.
- Specified by:
namein 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:CounterConfigurationBuilderSets the counter's initial value.Default value is zero.
- Specified by:
initialValuein 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:CounterConfigurationBuilderSets the counter's storage mode.Default value is
Storage.VOLATILE.- Specified by:
storagein 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 String name()
-
addStrongCounter
public StrongCounterConfigurationBuilder addStrongCounter()
- Specified by:
addStrongCounterin 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:
addWeakCounterin interfaceCounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T,S>>- Returns:
- a new builder to configure a weak counter.
-
-