Package com.hazelcast.projection
Class Projections
- java.lang.Object
-
- com.hazelcast.projection.Projections
-
public final class Projections extends java.lang.Object
A utility class to create basicProjection
instances.- Since:
- 3.8
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Projection<T,T>
identity()
Returns a projection that does no transformation.static <I> Projection<I,java.lang.Object[]>
multiAttribute(java.lang.String... attributePaths)
Returns a projection that extracts the value of the givenattributePaths
.static <I,O>
Projection<I,O>singleAttribute(java.lang.String attributePath)
Returns a projection that extracts the value of the givenattributePath
.
-
-
-
Method Detail
-
identity
public static <T> Projection<T,T> identity()
Returns a projection that does no transformation.If you use the returned projection in a 3.9 cluster it may cause a serialization exception.
- Type Parameters:
T
- type- Since:
- 3.10
-
singleAttribute
public static <I,O> Projection<I,O> singleAttribute(java.lang.String attributePath)
Returns a projection that extracts the value of the givenattributePath
.- Type Parameters:
I
- input typeO
- output type- Parameters:
attributePath
- single attribute path, path must not be null or empty
-
multiAttribute
public static <I> Projection<I,java.lang.Object[]> multiAttribute(java.lang.String... attributePaths)
Returns a projection that extracts the value of the givenattributePaths
. The attribute values will be returned as anObject[]
array from each projection call.- Type Parameters:
I
- input type- Parameters:
attributePaths
- attribute paths, paths must not be null or empty
-
-