Class StrongCounterConfigurationBuilder
java.lang.Object
org.infinispan.counter.configuration.StrongCounterConfigurationBuilder
- All Implemented Interfaces:
Builder<StrongCounterConfiguration>
,Self<StrongCounterConfigurationBuilder>
,CounterConfigurationBuilder<StrongCounterConfiguration,
StrongCounterConfigurationBuilder>
StrongCounter
configuration builder.- Since:
- 9.0
- Author:
- Pedro Ruivo
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptioncreate()
Create the configuration beaninitialValue
(long initialValue) Sets the counter's initial value.lifespan
(long value) lowerBound
(long value) Sets the lower bound (inclusive) of the counter if a bounded counter is desired.name()
Sets the counter's name.Builder<?>
read
(StrongCounterConfiguration template, Combine combine) Reads the configuration from an already created configuration bean into this builder.self()
Sets the counter's storage mode.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
-
Constructor Details
-
StrongCounterConfigurationBuilder
-
-
Method Details
-
attributes
-
upperBound
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
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.
-
lifespan
-
create
Description copied from interface:Builder
Create the configuration bean- Returns:
-
read
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.combine
- the way attributes and children of this instance and the template should be combined.
-
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
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
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
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:
-
name
- Specified by:
name
in interfaceCounterConfigurationBuilder<T extends AbstractCounterConfiguration,
S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T, S>>
-
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
- 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.
-