Interface Projection<I,O>

Type Parameters:
I - input type
O - output type
All Superinterfaces:
Serializable
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Projection<I,O> extends Serializable
Enables transforming object into other objects. Exemplary usage scenario is the project() method of the IMap

Only 1:1 transformations allowed. Use an Aggregator to perform N:1 or N:M aggregations.

      IMap<String, Employee> employees = instance.getMap("employees");

      Collection<String> names = employees.project(new Projection<Map.Entry<String,Employee>,String>(){
          @Override
          public String transform(Map.Entry<String, Employee> entry){
              return entry.getValue().getName();
          }
      });
 
Since:
3.8
  • Method Summary

    Modifier and Type
    Method
    Description
    transform(I input)
    Transforms the input object into the output object.
  • Method Details

    • transform

      O transform(I input)
      Transforms the input object into the output object.
      Parameters:
      input - object.
      Returns:
      the output object.