com.hazelcast.projection

## 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 Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> Projection<T,T>` | `identity()` Returns a projection that does no transformation.
    `static <I> Projection<I,Object[]>` | `multiAttribute(String... attributePaths)` Returns a projection that extracts the value of the given `attributePaths`.
    `static <I,O> Projection<I,O>` | `singleAttribute(String attributePath)` Returns a projection that extracts the value of the given `attributePath`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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.

      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:
        `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.
      Parameters:
        `attributePaths` - attribute paths, paths must not be null or empty

Copyright © 2020. All rights reserved.