@java.lang.SuppressWarnings({"rawtypes", "unchecked"}) public class ManualProjections extends java.lang.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(java.util.Collection results, java.lang.String property) Counts the number of distinct values |
|
public java.util.Collection |
distinct(java.util.Collection results, java.lang.String property) |
|
public java.lang.Object |
max(java.util.Collection results, java.lang.String property) Calculates the maximum value of a property |
|
public java.lang.Object |
min(java.util.Collection results, java.lang.String property) Calculates the minimum value of a property |
|
public java.util.List |
property(java.util.Collection results, java.lang.String property) Obtains a properties value from the results |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
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