Package com.appiancorp.common.query
Class QueryBuilderTools.Aggregator
java.lang.Object
com.appiancorp.common.query.QueryBuilderTools.Aggregator
- Direct Known Subclasses:
GenericQuery.GenericBuilder.Aggregator
,TypedValueQuery.TypedValueBuilder.Aggregator
- Enclosing interface:
- QueryBuilderTools
This class encapsulates all the available Aggregation Functions in a more object oriented way.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AggregationColumn
aggregation
(String field, AggregationFunction function) Creates anAggregationColumn
instancestatic AggregationColumn
aggregation
(String field, String alias, boolean visible, AggregationFunction function) Creates anAggregationColumn
instance.static AggregationColumn
Apply a "average" aggregation function to the givenColumn
static AggregationColumn
avg
(ColumnAlias alias) Apply a "average" aggregation function to the givenColumnAlias
static AggregationColumn
avg
(ColumnAlias alias, boolean visibility) Apply a "average" aggregation function to the givenColumnAlias
.static AggregationColumn
Apply a "average" aggregation function to the given field name.static AggregationColumn
Apply a "average" aggregation function to the given field name.static AggregationColumn
Apply a "count" aggregation function to the givenColumn
static AggregationColumn
count
(ColumnAlias alias) Apply a "count" aggregation function to the givenColumnAlias
static AggregationColumn
count
(ColumnAlias alias, boolean visibility) Apply a "count" aggregation function to the givenColumnAlias
.static AggregationColumn
Apply a "count" aggregation function to the given field name.static AggregationColumn
Apply a "count" aggregation function to the given field name.static AggregationColumn
Creates a grouping projection for the givenColumn
static AggregationColumn
group
(ColumnAlias ca) Creates a grouping projection for the givenColumnAlias
This projection can be referred to by the given alias.static AggregationColumn
Creates a grouping projection for the given field namestatic AggregationColumn
Creates a visible or hidden grouping projection for the given field namestatic AggregationColumn
Creates a grouping projection for the given field name.static AggregationColumn
Creates a visible or hidden grouping projection for the given field name.static AggregationColumn
group
(String field, String alias, com.appiancorp.common.query.GroupingFunction groupingFunction, boolean visible) static AggregationColumn
Apply a "maximum" aggregation function to the givenColumn
static AggregationColumn
max
(ColumnAlias alias) Apply a "maximum" aggregation function to the givenColumnAlias
static AggregationColumn
max
(ColumnAlias alias, boolean visibility) Apply a "maximum" aggregation function to the givenColumnAlias
.static AggregationColumn
Apply a "maximum" aggregation function to the given field name.static AggregationColumn
Apply a "maximum" aggregation function to the given field name.static AggregationColumn
Apply a "minimum" aggregation function to the givenColumn
static AggregationColumn
min
(ColumnAlias alias) Apply a "minimum" aggregation function to the givenColumnAlias
static AggregationColumn
min
(ColumnAlias alias, boolean visibility) Apply a "minimum" aggregation function to the givenColumnAlias
.static AggregationColumn
Apply a "minimum" aggregation function to the given field name.static AggregationColumn
Apply a "minimum" aggregation function to the given field name.static AggregationColumn
Apply a "summation" aggregation function to the givenColumn
static AggregationColumn
sum
(ColumnAlias alias) Apply a "summation" aggregation function to the givenColumnAlias
static AggregationColumn
sum
(ColumnAlias alias, boolean visibility) Apply a "summation" aggregation function to the givenColumnAlias
.static AggregationColumn
Apply a "summation" aggregation function to the given field name.static AggregationColumn
Apply a "summation" aggregation function to the given field name.
-
Constructor Details
-
Aggregator
public Aggregator()
-
-
Method Details
-
group
Creates a grouping projection for the given field name- Parameters:
field
- a field name- Returns:
- an
AggregationColumn
representing a grouping projection
-
group
Creates a grouping projection for the given field name. This projection can be referred to by the given alias.- Parameters:
field
- a field namealias
- an alias name to assign to the projection- Returns:
- an
AggregationColumn
representing a grouping projection
-
group
Creates a visible or hidden grouping projection for the given field name- Parameters:
field
- a field namevisible
- iftrue
the projection will be visible; otherwise it will be hidden- Returns:
- an
AggregationColumn
representing a grouping projection
-
group
Creates a grouping projection for the givenColumnAlias
This projection can be referred to by the given alias.- Parameters:
ca
- aColumnAlias
to assign to the projection- Returns:
- an
AggregationColumn
representing a grouping projection
-
group
Creates a visible or hidden grouping projection for the given field name. This projection can be referred to by the given alias.- Parameters:
field
- a field namealias
- an alias name to assign to the projectionvisible
- iftrue
the projection will be visible; otherwise it will be hidden- Returns:
- an
AggregationColumn
representing a grouping projection
-
group
Creates a grouping projection for the givenColumn
- Parameters:
c
- aColumn
- Returns:
- an
AggregationColumn
representing a grouping projection
-
group
public static AggregationColumn group(String field, String alias, com.appiancorp.common.query.GroupingFunction groupingFunction, boolean visible) -
aggregation
Creates anAggregationColumn
instance- Parameters:
field
- a field namefunction
- an aggregation function define by theAggregationFunction
enum- Returns:
- an
AggregationColumn
instance
-
aggregation
public static AggregationColumn aggregation(String field, String alias, boolean visible, AggregationFunction function) Creates anAggregationColumn
instance. This projection can be referred to by the given alias.- Parameters:
field
- a field namealias
- an alias name to assign to the projectionvisible
- iftrue
the projection will be visible; otherwise it will be hiddenfunction
- an aggregation function define by theAggregationFunction
enum- Returns:
- an
AggregationColumn
instance
-
sum
Apply a "summation" aggregation function to the givenColumnAlias
- Parameters:
alias
- aColumnAlias
to assign to the projection- Returns:
- an
AggregationColumn
where "summation" is applied.
-
avg
Apply a "average" aggregation function to the givenColumnAlias
- Parameters:
alias
- aColumnAlias
to assign to the projection- Returns:
- an
AggregationColumn
where "average" is applied.
-
count
Apply a "count" aggregation function to the givenColumnAlias
- Parameters:
alias
- aColumnAlias
to assign to the projection- Returns:
- an
AggregationColumn
where "count" is applied.
-
min
Apply a "minimum" aggregation function to the givenColumnAlias
- Parameters:
alias
- aColumnAlias
to assign to the projection- Returns:
- an
AggregationColumn
where "minimum" is applied.
-
max
Apply a "maximum" aggregation function to the givenColumnAlias
- Parameters:
alias
- aColumnAlias
to assign to the projection- Returns:
- an
AggregationColumn
where "maximum" is applied.
-
sum
Apply a "summation" aggregation function to the given field name. This projection can be referred to by the given alias.- Parameters:
c
- field namealias
- an alias name to assign to the projection- Returns:
- an
AggregationColumn
where "summation" is applied.
-
avg
Apply a "average" aggregation function to the given field name. This projection can be referred to by the given alias.- Parameters:
c
- field namealias
- an alias name to assign to the projection- Returns:
- an
AggregationColumn
where "average" is applied.
-
count
Apply a "count" aggregation function to the given field name. This projection can be referred to by the given alias.- Parameters:
c
- field namealias
- an alias name to assign to the projection- Returns:
- an
AggregationColumn
where "count" is applied.
-
min
Apply a "minimum" aggregation function to the given field name. This projection can be referred to by the given alias.- Parameters:
c
- field namealias
- an alias name to assign to the projection- Returns:
- an
AggregationColumn
where "minimum" is applied.
-
max
Apply a "maximum" aggregation function to the given field name. This projection can be referred to by the given alias.- Parameters:
c
- field namealias
- an alias name to assign to the projection- Returns:
- an
AggregationColumn
where "maximum" is applied.
-
sum
Apply a "summation" aggregation function to the given field name. This projection can be referred to by the given alias.- Parameters:
c
- field namealias
- an alias name to assign to the projectionvisibility
- iftrue
the projection will be visible; otherwise it will be hidden- Returns:
- an
AggregationColumn
where "summation" is applied.
-
avg
Apply a "average" aggregation function to the given field name. This projection can be referred to by the given alias.- Parameters:
c
- field namealias
- an alias name to assign to the projectionvisibility
- iftrue
the projection will be visible; otherwise it will be hidden- Returns:
- an
AggregationColumn
where "average" is applied.
-
count
Apply a "count" aggregation function to the given field name. This projection can be referred to by the given alias.- Parameters:
c
- field namealias
- an alias name to assign to the projectionvisibility
- iftrue
the projection will be visible; otherwise it will be hidden- Returns:
- an
AggregationColumn
where "count" is applied.
-
min
Apply a "minimum" aggregation function to the given field name. This projection can be referred to by the given alias.- Parameters:
c
- field namealias
- an alias name to assign to the projectionvisibility
- iftrue
the projection will be visible; otherwise it will be hidden- Returns:
- an
AggregationColumn
where "minimum" is applied.
-
max
Apply a "maximum" aggregation function to the given field name. This projection can be referred to by the given alias.- Parameters:
c
- field namealias
- an alias name to assign to the projectionvisibility
- iftrue
the projection will be visible; otherwise it will be hidden- Returns:
- an
AggregationColumn
where "maximum" is applied.
-
sum
Apply a "summation" aggregation function to the givenColumnAlias
. This projection can be referred to by the given alias.- Parameters:
alias
- aColumnAlias
to assign to the projectionvisibility
- iftrue
the projection will be visible; otherwise it will be hidden- Returns:
- an
AggregationColumn
where "summation" is applied.
-
avg
Apply a "average" aggregation function to the givenColumnAlias
. This projection can be referred to by the given alias.- Parameters:
alias
- aColumnAlias
to assign to the projectionvisibility
- iftrue
the projection will be visible; otherwise it will be hidden- Returns:
- an
AggregationColumn
where "average" is applied.
-
count
Apply a "count" aggregation function to the givenColumnAlias
. This projection can be referred to by the given alias.- Parameters:
alias
- aColumnAlias
to assign to the projectionvisibility
- iftrue
the projection will be visible; otherwise it will be hidden- Returns:
- an
AggregationColumn
where "count" is applied.
-
min
Apply a "minimum" aggregation function to the givenColumnAlias
. This projection can be referred to by the given alias.- Parameters:
alias
- aColumnAlias
to assign to the projectionvisibility
- iftrue
the projection will be visible; otherwise it will be hidden- Returns:
- an
AggregationColumn
where "minimum" is applied.
-
max
Apply a "maximum" aggregation function to the givenColumnAlias
. This projection can be referred to by the given alias.- Parameters:
alias
- aColumnAlias
to assign to the projectionvisibility
- iftrue
the projection will be visible; otherwise it will be hidden- Returns:
- an
AggregationColumn
where "maximum" is applied.
-
sum
Apply a "summation" aggregation function to the givenColumn
- Parameters:
c
- aColumn
- Returns:
- an
AggregationColumn
where "summation" is applied.
-
avg
Apply a "average" aggregation function to the givenColumn
- Parameters:
c
- aColumn
- Returns:
- an
AggregationColumn
where "average" is applied.
-
count
Apply a "count" aggregation function to the givenColumn
- Parameters:
c
- aColumn
- Returns:
- an
AggregationColumn
where "count" is applied.
-
min
Apply a "minimum" aggregation function to the givenColumn
- Parameters:
c
- aColumn
- Returns:
- an
AggregationColumn
where "minimum" is applied.
-
max
Apply a "maximum" aggregation function to the givenColumn
- Parameters:
c
- aColumn
- Returns:
- an
AggregationColumn
where "maximum" is applied.
-