Class AggregationUtility<T extends AggregatedRecord<T,?>>
java.lang.Object
org.gcube.documentstore.records.aggregation.AggregationUtility<T>
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidRemove all fields which are not in AggregationFields nor in AggregatedFields SetsbooleanisAggregable(T record) Check if the record provided as argument is aggregable with the one provided to the Constructor.voidsetAggregationFields(Set<String> aggregationFields) This function is used to set the Set of Aggregation Fields.protected voidprotected voidvoidsetNeededFields(Set<String> neededFields) This function is used to set the Set of Needed Fields to keep after aggregation.
-
Field Details
-
t
-
aggregationFields
-
neededFields
-
-
Constructor Details
-
AggregationUtility
-
-
Method Details
-
setDefaultAggregationFields
protected void setDefaultAggregationFields() -
setDefaultNeededFields
protected void setDefaultNeededFields() -
setAggregationFields
This function is used to set the Set of Aggregation Fields. By default this Set if composed by Required Fields for lossless aggregation. If you want perform lossy aggregation set this Set consistently with NeededFields usingsetNeededFields(java.util.Set<java.lang.String>)- Parameters:
aggregationFields-
-
setNeededFields
This function is used to set the Set of Needed Fields to keep after aggregation. All other fields are removed. By default this Set if composed by Required Fields and AggregationField for lossless aggregation. If you want perform lossy aggregation set this Set consistently with AggregationFields usingsetAggregationFields(java.util.Set<java.lang.String>)- Parameters:
neededFields-
-
isAggregable
Check if the record provided as argument is aggregable with the one provided to the Constructor. This is done comparing the value of each AggregationFields- Parameters:
record- to check- Returns:
- true if the record provided as argument is aggregable with the one provided to the Constructor. False otherwise.
-
cleanExtraFields
protected void cleanExtraFields()Remove all fields which are not in AggregationFields nor in AggregatedFields Sets -
aggregate
- Throws:
NotAggregatableRecordsExceptions
-