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 useWriteableCacheCollectionMapperinstead as it allows for constant time contains and other operationsACacheCollectionthat 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,?>keyFilterMapperDeprecated.protected CacheCollection<E>realCacheCollectionDeprecated.-
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:CloseableIteratorCollectionThis spliterator should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
spliteratorin interfaceCloseableIteratorCollection<E>- Specified by:
spliteratorin interfaceCollection<E>- Specified by:
spliteratorin interfaceIterable<E>- Overrides:
spliteratorin classCollectionMapper<E,R>
-
iterator
public CloseableIterator<R> iterator()
Deprecated.Description copied from interface:CloseableIteratorCollectionThis 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:
iteratorin interfaceCloseableIteratorCollection<E>- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Overrides:
iteratorin classCollectionMapper<E,R>
-
stream
public CacheStream<R> stream()
Deprecated.Description copied from interface:CloseableIteratorCollectionThis stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
streamin interfaceCacheCollection<E>- Specified by:
streamin interfaceCloseableIteratorCollection<E>- Specified by:
streamin interfaceCollection<E>- Overrides:
streamin classCollectionMapper<E,R>
-
parallelStream
public CacheStream<R> parallelStream()
Deprecated.Description copied from interface:CloseableIteratorCollectionThis stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
parallelStreamin interfaceCacheCollection<E>- Specified by:
parallelStreamin interfaceCloseableIteratorCollection<E>- Specified by:
parallelStreamin interfaceCollection<E>- Overrides:
parallelStreamin classCollectionMapper<E,R>
-
-