Class MultiAttributeProjection<K,V,R>
java.lang.Object
com.loomcache.server.compute.MultiAttributeProjection<K,V,R>
- Type Parameters:
K- the type of the keyV- the type of the valueR- the type of each attribute
- All Implemented Interfaces:
Projection<K,V, List<R>>
Built-in projection that extracts multiple attributes from values.
Returns an unmodifiable list of attributes extracted from each value.
Usage:
MultiAttributeProjectioninvalid input: '<'String, Person, Object> multiProj = new MultiAttributeProjectioninvalid input: '<'>( Person::getName, Person::getAge, Person::getEmail ); Listinvalid input: '<'List
-
Constructor Summary
ConstructorsConstructorDescriptionMultiAttributeProjection(Function<V, R>... extractors) Create a new multi-attribute projection. -
Method Summary
-
Constructor Details
-
MultiAttributeProjection
Create a new multi-attribute projection.- Parameters:
extractors- the functions to extract attributes from the value (must not be empty)- Throws:
IllegalArgumentException- if extractors is null or empty
-
-
Method Details
-
transform
Description copied from interface:ProjectionTransform a map entry to the projected result.- Specified by:
transformin interfaceProjection<K,V, R> - Parameters:
entry- the detached, immutable entry snapshot to transform; the server provides a read-only snapshot, and direct callers must do the same because invokingMap.Entry.setValue(Object)never updates cache state and is unsupported- Returns:
- the projected result
-