public class StrongCounterConfigurationBuilder extends Object
StrongCounter
configuration builder.Modifier and Type | Method and Description |
---|---|
StrongCounterConfigurationBuilder |
addStrongCounter() |
WeakCounterConfigurationBuilder |
addWeakCounter() |
StrongCounterConfiguration |
create()
Create the configuration bean
|
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.
|
String |
name() |
S |
name(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
|
public StrongCounterConfigurationBuilder upperBound(long value)
Default value is Long.MAX_VALUE
.
value
- the new counter's upper bound.public StrongCounterConfigurationBuilder lowerBound(long value)
Default value is Long.MIN_VALUE
.
value
- the new counter's lower bound.public StrongCounterConfiguration create()
Builder
public Builder<?> read(StrongCounterConfiguration template)
Builder
template
- the configuration from which to "clone" this config if needed.public StrongCounterConfigurationBuilder self()
public void validate()
Builder
validate
in interface Builder<StrongCounterConfiguration>
public final S name(String name)
CounterConfigurationBuilder
This attribute is required.
name
in interface CounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T,S>>
name
- the counter's name.public final S initialValue(long initialValue)
CounterConfigurationBuilder
Default value is zero.
initialValue
in interface CounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T,S>>
initialValue
- the counter's initial value.public final S storage(Storage mode)
CounterConfigurationBuilder
Default value is Storage.VOLATILE
.
storage
in interface CounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T,S>>
mode
- the counter's storage mode.Storage
public String name()
public StrongCounterConfigurationBuilder addStrongCounter()
addStrongCounter
in interface CounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T,S>>
public WeakCounterConfigurationBuilder addWeakCounter()
addWeakCounter
in interface CounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T,S>>
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.