org.organicdesign.fp.collections.ImMapTrans Maven / Gradle / Ivy
package org.organicdesign.fp.collections;
/**
Allows a map to be taken from transient to persistent. This is NOT inherently thread-safe and calls to the
asTransient() and persistent() methods need to be wrapped in a thread-safe manner.
This bridges that gap to let PersistentHashSet know about the asTransient() method for accessing PersistentHashMap's
inner transient class, which in turn, allows this class to implement keySet for PersistentHashMap. Also allows
*/
public interface ImMapTrans extends ImMap {
ImMapTrans asTransient();
/** Returns the Equator used by this map for equals comparisons and hashCodes */
Equator equator();
ImMapTrans persistent();
/** {@inheritDoc} */
@Override default ImSet keySet() { return PersistentHashSet.ofMap(this); }
/** {@inheritDoc} */
@Override ImMapTrans assoc(K key, V val);
/** {@inheritDoc} */
@Override ImMapTrans without(K key);
}