org.infinispan.util.CacheCollectionMapper Maven / Gradle / Ivy
package org.infinispan.util;
import java.util.Collection;
import java.util.function.Function;
import org.infinispan.CacheCollection;
import org.infinispan.CacheStream;
import org.infinispan.commons.util.CloseableIterator;
import org.infinispan.commons.util.CloseableSpliterator;
import org.infinispan.commons.util.InjectiveFunction;
import org.infinispan.commons.util.IteratorMapper;
import org.infinispan.commons.util.SpliteratorMapper;
/**
* A {@link CacheCollection} that allows for a different set to be mapped as
* a different instance with values replaced on request. This is useful as a
* cache collection that is normally lazily evaluated to prevent having to
* pull all values into memory which can be a lot faster when checking single
* values and can also prevent out of memory issues.
*
* Some operations such as {@link Collection#contains(Object)} and {@link Collection#containsAll(Collection)} may be
* more expensive then normal since they cannot utilize lookups into the original collection.
* @param Type of elements in collection before transformation
* @param Type of elements in collection after transformation
* @since 9.0
* @deprecated since 9.2.1 It is recommended to use {@link WriteableCacheCollectionMapper} instead as it allows for
* constant time contains and other operations
*/
@Deprecated
public class CacheCollectionMapper extends CollectionMapper implements CacheCollection {
protected final CacheCollection realCacheCollection;
protected final InjectiveFunction
© 2015 - 2025 Weber Informatics LLC | Privacy Policy