@SuppressWarnings({ "rawtypes", "unchecked" }) public class ManualProjections extends Object
Implements common projections in-memory given a set of results. Not all NoSQL datastores support projections like SQL min(..), max(..) etc. This class provides support for those that don't.
| Constructor and description |
|---|
ManualProjections(PersistentEntity entity) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public int |
countDistinct(Collection results, String property)Counts the number of distinct values |
|
public Collection |
distinct(Collection results, String property) |
|
public Object |
max(Collection results, String property)Calculates the maximum value of a property |
|
public Object |
min(Collection results, String property)Calculates the minimum value of a property |
|
public List |
property(Collection results, String property)Obtains a properties value from the results |
Counts the number of distinct values
results - The resultsproperty - The propertyCalculates the maximum value of a property
results - The resultsproperty - The property to calculateCalculates the minimum value of a property
results - The resultsproperty - The property to calculateObtains a properties value from the results
results - The resultsproperty - The property