mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-81 extend support for mapForkey to all maps.
This commit is contained in:
@@ -166,7 +166,7 @@ public interface ChronicleMap<K, V> extends ConcurrentMap<K, V>, ChronicleHash {
|
||||
* defaultValueProvider.}
|
||||
*
|
||||
* <p>If the {@code ChronicleMap} is off-heap updatable, i. e. created via {@link
|
||||
* ChronicleMapBuilder} builder (values are {@link Byteable}), there is one more option of
|
||||
* ChronicleMapBuilder} builder (values are {@tlink Byteable}), there is one more option of
|
||||
* what to do if the key is absent in the map, see {@link ChronicleMapBuilder#prepareValueBytesOnAcquire(PrepareValueBytes)}.
|
||||
* By default, value bytes are just zeroed out, no default value, either provided for key or constant, is
|
||||
* put for the absent key.
|
||||
@@ -182,5 +182,16 @@ public interface ChronicleMap<K, V> extends ConcurrentMap<K, V>, ChronicleHash {
|
||||
@NotNull
|
||||
WriteContext<K, V> acquireUsingLocked(@NotNull K key, @NotNull V usingValue);
|
||||
|
||||
/**
|
||||
* Apply a mapping to the value returned by a key and return a result.
|
||||
* A read lock is assumed.
|
||||
*
|
||||
* @param key to apply the mapping to
|
||||
* @param function to calculate a result
|
||||
* @param <R> return type.
|
||||
* @return the result of the function.
|
||||
*/
|
||||
<R> R mapForKey(K key, @NotNull Function<? super V, R> function);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user