Class Projections

java.lang.Object
com.hazelcast.projection.Projections

public final class Projections extends Object
A utility class to create basic Projection instances.
Since:
3.8
  • Method Details

    • 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(String attributePath)
      Returns a projection that extracts the value of the given attributePath.
      Type Parameters:
      I - input type
      O - output type
      Parameters:
      attributePath - single attribute path, path must not be null or empty
    • multiAttribute

      public static <I> Projection<I,Object[]> multiAttribute(String... attributePaths)
      Returns a projection that extracts the value of the given attributePaths. The attribute values will be returned as an Object[] array from each projection call.
      Type Parameters:
      I - input type
      Parameters:
      attributePaths - attribute paths, paths must not be null or empty