public class ChronicleMapStateRepository<V> extends ConcurrentMapStateRepository<V>
| Modifier and Type | Class and Description |
|---|---|
static class |
ChronicleMapStateRepository.Builder<V> |
| Modifier and Type | Method and Description |
|---|---|
static <V> ChronicleMapStateRepository.Builder<V> |
builder(java.lang.Class<V> clazz) |
java.util.Optional<V> |
get(java.lang.String key)
Returns the optional value to which the specified key is mapped,
or
Optional.empty() if this repository contains no mapping for the key. |
java.util.Optional<V> |
put(java.lang.String key,
V value)
Associates the specified value with the specified key in this repository.
|
long |
size()
Returns the number of key-value mappings in this repository.
|
public java.util.Optional<V> put(java.lang.String key, V value)
StateRepositorym.get(k) would return
a non-empty value.)put in interface StateRepository<V>put in class ConcurrentMapStateRepository<V>key - key with which the specified value is to be associatedvalue - value to be associated with the specified keypublic java.util.Optional<V> get(java.lang.String key)
StateRepositoryOptional.empty() if this repository contains no mapping for the key.
More formally, if this repository contains a mapping from a key
k to a value v such that (key==null ? k==null :
key.equals(k)), then this method returns Optional.of(v); otherwise
it returns Optional.empty(). (There can be at most one such mapping.)
get in interface StateRepository<V>get in class ConcurrentMapStateRepository<V>key - the key whose associated value is to be returnedOptional.empty() if this repository contains no mapping for the keypublic long size()
StateRepositorysize in interface StateRepository<V>size in class ConcurrentMapStateRepository<V>public static <V> ChronicleMapStateRepository.Builder<V> builder(java.lang.Class<V> clazz)