Note that while interface itself does not specify synchronization requirements for implementations, specific use cases do. Typically implementations are expected to be thread-safe, that is, to handle synchronization.
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public default void | contents(BiConsumer<K, V>
Operation to apply on cache contents. consumer)Method to apply operation on cache contents without exposing them. |
| public default LookupCache | |
| public V | |
| public V | |
| public V | |
| public int | Returns: Number of entries currently in cache: may be approximate, only to be used for diagnostics, metrics reporting
|
| clear | back to summary |
|---|---|
| public void clear() Method for removing all contents this cache has. | |
| contents | back to summary |
|---|---|
| public default void contents(BiConsumer<K, V> consumer) Method to apply operation on cache contents without exposing them.
Default implementation throws
| |
| emptyCopy | back to summary |
|---|---|
| public default LookupCache Method needed for creating clones but without contents.
Default implementation throws
| |
| get | back to summary |
|---|---|
| public V get(Object key) Note key is of type Object only to retain binary backwards-compatibility
| |
| put | back to summary |
|---|---|
| public V put(K key, V value) | |
| putIfAbsent | back to summary |
|---|---|
| public V putIfAbsent(K key, V value) | |
| size | back to summary |
|---|---|
public int size()
| |