org.infinispan.counter.configuration.CounterConfigurationBuilder Maven / Gradle / Ivy
Show all versions of infinispan-clustered-counter Show documentation
package org.infinispan.counter.configuration;
import org.infinispan.commons.configuration.Builder;
import org.infinispan.commons.configuration.Self;
import org.infinispan.counter.api.Storage;
/**
* Base counter configuration builder.
*
* It allows to configure the name, initial value and the {@link Storage} mode. The counter's name is required.
*
* @author Pedro Ruivo
* @since 9.0
*/
public interface CounterConfigurationBuilder>
extends Builder, Self {
/**
* Sets the counter's name.
*
* This attribute is required.
*
* @param name the counter's name.
*/
S name(String name);
String name();
/**
* Sets the counter's initial value.
*
* Default value is zero.
*
* @param initialValue the counter's initial value.
*/
S initialValue(long initialValue);
/**
* Sets the counter's storage mode.
*
* Default value is {@link Storage#VOLATILE}.
*
* @param mode the counter's storage mode.
* @see Storage
*/
S storage(Storage mode);
/**
* @return a new builder to configure a strong counter.
*/
StrongCounterConfigurationBuilder addStrongCounter();
/**
* @return a new builder to configure a weak counter.
*/
WeakCounterConfigurationBuilder addWeakCounter();
}