Package com.hazelcast.projection
Interface Projection<I,O>
- Type Parameters:
I- input typeO- 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.
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
-
Method Details
-
transform
Transforms the input object into the output object.- Parameters:
input- object.- Returns:
- the output object.
-