HCOLL-81 make it clear that mapForKey is read only as it uses a Function and updateForKey is read/write and takes a mutator.

This commit is contained in:
Peter Lawrey
2014-11-15 12:56:37 +00:00
parent 80ba83a669
commit 3750bc4f8e
7 changed files with 120 additions and 35 deletions
@@ -0,0 +1,22 @@
package net.openhft.chronicle.map;
import java.io.Serializable;
/**
* Represents a mutator that accepts one mutable argument, which it may alter and produces a result.
* <p/>
* <p>This is not functional as it can alter an argument.
*
* @param <T> the type of the mutable input
* @param <R> the type of the result of the mutator
*/
public interface Mutator<T, R> extends Serializable {
/**
* Applies this mutator to the given mutable argument.
*
* @param t the mutator argument
* @return the result
*/
R update(T t);
}