Class CacheCollectionMapper<E,​R>

  • Type Parameters:
    E - Type of elements in collection before transformation
    R - Type of elements in collection after transformation
    All Implemented Interfaces:
    Iterable<R>, Collection<R>, CacheCollection<R>, CloseableIteratorCollection<R>

    public class CacheCollectionMapper<E,​R>
    extends CollectionMapper<E,​R>
    implements CacheCollection<R>
    since 9.2.1 It is recommended to use WriteableCacheCollectionMapper instead as it allows for constant time contains and other operations
    A 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 Collection.contains(Object) and Collection.containsAll(Collection) may be more expensive then normal since they cannot utilize lookups into the original collection.