Package org.infinispan.util
Class CacheCollectionMapper<E,R>
- java.lang.Object
-
- java.util.AbstractCollection<R>
-
- org.infinispan.util.CollectionMapper<E,R>
-
- org.infinispan.util.CacheCollectionMapper<E,R>
-
- Type Parameters:
E
- Type of elements in collection before transformationR
- Type of elements in collection after transformation
- All Implemented Interfaces:
Iterable<R>
,Collection<R>
,CacheCollection<R>
,CloseableIteratorCollection<R>
@Deprecated public class CacheCollectionMapper<E,R> extends CollectionMapper<E,R> implements CacheCollection<R>
Deprecated.since 9.2.1 It is recommended to useWriteableCacheCollectionMapper
instead as it allows for constant time contains and other operationsACacheCollection
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
Collection.contains(Object)
andCollection.containsAll(Collection)
may be more expensive then normal since they cannot utilize lookups into the original collection.- Since:
- 9.0
-
-
Field Summary
Fields Modifier and Type Field Description protected InjectiveFunction<Object,?>
keyFilterMapper
Deprecated.protected CacheCollection<E>
realCacheCollection
Deprecated.-
Fields inherited from class org.infinispan.util.CollectionMapper
mapper, realCollection
-
-
Constructor Summary
Constructors Constructor Description CacheCollectionMapper(CacheCollection<E> realCollection, Function<? super E,? extends R> mapper)
Deprecated.CacheCollection that maps entries to new type that takes a key filter that isFunction.identity()
CacheCollectionMapper(CacheCollection<E> realCollection, Function<? super E,? extends R> mapper, InjectiveFunction<Object,?> keyFilterMapper)
Deprecated.CacheCollection that maps entries to new type that takes a provided key filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CloseableIterator<R>
iterator()
Deprecated.CacheStream<R>
parallelStream()
Deprecated.CloseableSpliterator<R>
spliterator()
Deprecated.CacheStream<R>
stream()
Deprecated.-
Methods inherited from class org.infinispan.util.CollectionMapper
add, addAll, clear, forEach, isEmpty, remove, removeAll, retainAll, size
-
Methods inherited from class java.util.AbstractCollection
contains, containsAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
realCacheCollection
protected final CacheCollection<E> realCacheCollection
Deprecated.
-
keyFilterMapper
protected final InjectiveFunction<Object,?> keyFilterMapper
Deprecated.
-
-
Constructor Detail
-
CacheCollectionMapper
public CacheCollectionMapper(CacheCollection<E> realCollection, Function<? super E,? extends R> mapper)
Deprecated.CacheCollection that maps entries to new type that takes a key filter that isFunction.identity()
- Parameters:
realCollection
- the collection storing original entriesmapper
- the mapper to the new type
-
CacheCollectionMapper
public CacheCollectionMapper(CacheCollection<E> realCollection, Function<? super E,? extends R> mapper, InjectiveFunction<Object,?> keyFilterMapper)
Deprecated.CacheCollection that maps entries to new type that takes a provided key filter.- Parameters:
realCollection
- the collection storing original entriesmapper
- the mapper to the new typekeyFilterMapper
- the key filter mapper to use (since collection may not be the same type)
-
-
Method Detail
-
spliterator
public CloseableSpliterator<R> spliterator()
Deprecated.Description copied from interface:CloseableIteratorCollection
This spliterator should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
spliterator
in interfaceCloseableIteratorCollection<E>
- Specified by:
spliterator
in interfaceCollection<E>
- Specified by:
spliterator
in interfaceIterable<E>
- Overrides:
spliterator
in classCollectionMapper<E,R>
-
iterator
public CloseableIterator<R> iterator()
Deprecated.Description copied from interface:CloseableIteratorCollection
This iterator should be explicitly closed when iteration upon it is completed. Failure to do so could cause resources to not be freed properly
- Specified by:
iterator
in interfaceCloseableIteratorCollection<E>
- Specified by:
iterator
in interfaceCollection<E>
- Specified by:
iterator
in interfaceIterable<E>
- Overrides:
iterator
in classCollectionMapper<E,R>
-
stream
public CacheStream<R> stream()
Deprecated.Description copied from interface:CloseableIteratorCollection
This stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
stream
in interfaceCacheCollection<E>
- Specified by:
stream
in interfaceCloseableIteratorCollection<E>
- Specified by:
stream
in interfaceCollection<E>
- Overrides:
stream
in classCollectionMapper<E,R>
-
parallelStream
public CacheStream<R> parallelStream()
Deprecated.Description copied from interface:CloseableIteratorCollection
This stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
parallelStream
in interfaceCacheCollection<E>
- Specified by:
parallelStream
in interfaceCloseableIteratorCollection<E>
- Specified by:
parallelStream
in interfaceCollection<E>
- Overrides:
parallelStream
in classCollectionMapper<E,R>
-
-