Class WeakCounterConfigurationBuilder
- java.lang.Object
-
- org.infinispan.counter.configuration.WeakCounterConfigurationBuilder
-
- All Implemented Interfaces:
org.infinispan.commons.configuration.Builder<WeakCounterConfiguration>
,org.infinispan.commons.configuration.Self<WeakCounterConfigurationBuilder>
,CounterConfigurationBuilder<WeakCounterConfiguration,WeakCounterConfigurationBuilder>
public class WeakCounterConfigurationBuilder extends Object
WeakCounter
configuration builder.- Since:
- 9.0
- Author:
- Pedro Ruivo
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StrongCounterConfigurationBuilder
addStrongCounter()
WeakCounterConfigurationBuilder
addWeakCounter()
WeakCounterConfigurationBuilder
concurrencyLevel(int level)
Sets the counter's concurrency level.WeakCounterConfiguration
create()
Create the configuration beanS
initialValue(long initialValue)
Sets the counter's initial value.String
name()
S
name(String name)
Sets the counter's name.org.infinispan.commons.configuration.Builder<?>
read(WeakCounterConfiguration template)
Reads the configuration from an already created configuration bean into this builder.WeakCounterConfigurationBuilder
self()
S
storage(Storage mode)
Sets the counter's storage mode.void
validate()
Validate the data in this builder before building the configuration bean
-
-
-
Method Detail
-
create
public WeakCounterConfiguration create()
Description copied from interface:org.infinispan.commons.configuration.Builder
Create the configuration bean- Returns:
-
read
public org.infinispan.commons.configuration.Builder<?> read(WeakCounterConfiguration template)
Description copied from interface:org.infinispan.commons.configuration.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 WeakCounterConfigurationBuilder self()
-
concurrencyLevel
public WeakCounterConfigurationBuilder concurrencyLevel(int level)
Sets the counter's concurrency level.It sets the number of concurrent updates in the counter. A higher value will support a higher number of updates but it increases the read of the counter's value.
Default value is 16.
- Parameters:
level
- the new concurrency level.
-
name
public final S name(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
-
validate
public void validate()
Description copied from interface:org.infinispan.commons.configuration.Builder
Validate the data in this builder before building the configuration bean- Specified by:
validate
in interfaceorg.infinispan.commons.configuration.Builder<T extends AbstractCounterConfiguration>
-
name
public 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.
-
-