Class QueryBuilderTools.Aggregator

java.lang.Object
com.appiancorp.common.query.QueryBuilderTools.Aggregator
Direct Known Subclasses:
GenericQuery.GenericBuilder.Aggregator, TypedValueQuery.TypedValueBuilder.Aggregator
Enclosing interface:
QueryBuilderTools

public static class QueryBuilderTools.Aggregator extends Object

This class encapsulates all the available Aggregation Functions in a more object oriented way.

  • Constructor Details

    • Aggregator

      public Aggregator()
  • Method Details

    • group

      public static AggregationColumn group(String field)
      Creates a grouping projection for the given field name
      Parameters:
      field - a field name
      Returns:
      an AggregationColumn representing a grouping projection
    • group

      public static AggregationColumn group(String field, String alias)
      Creates a grouping projection for the given field name. This projection can be referred to by the given alias.
      Parameters:
      field - a field name
      alias - an alias name to assign to the projection
      Returns:
      an AggregationColumn representing a grouping projection
    • group

      public static AggregationColumn group(String field, boolean visible)
      Creates a visible or hidden grouping projection for the given field name
      Parameters:
      field - a field name
      visible - if true the projection will be visible; otherwise it will be hidden
      Returns:
      an AggregationColumn representing a grouping projection
    • group

      public static AggregationColumn group(ColumnAlias ca)
      Creates a grouping projection for the given ColumnAlias This projection can be referred to by the given alias.
      Parameters:
      ca - a ColumnAlias to assign to the projection
      Returns:
      an AggregationColumn representing a grouping projection
    • group

      public static AggregationColumn group(String field, String alias, boolean visible)
      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 name
      alias - an alias name to assign to the projection
      visible - if true the projection will be visible; otherwise it will be hidden
      Returns:
      an AggregationColumn representing a grouping projection
    • group

      public static AggregationColumn group(Column c)
      Creates a grouping projection for the given Column
      Parameters:
      c - a Column
      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

      public static AggregationColumn aggregation(String field, AggregationFunction function)
      Creates an AggregationColumn instance
      Parameters:
      field - a field name
      function - an aggregation function define by the AggregationFunction enum
      Returns:
      an AggregationColumn instance
    • aggregation

      public static AggregationColumn aggregation(String field, String alias, boolean visible, AggregationFunction function)
      Creates an AggregationColumn instance. This projection can be referred to by the given alias.
      Parameters:
      field - a field name
      alias - an alias name to assign to the projection
      visible - if true the projection will be visible; otherwise it will be hidden
      function - an aggregation function define by the AggregationFunction enum
      Returns:
      an AggregationColumn instance
    • sum

      public static AggregationColumn sum(ColumnAlias alias)
      Apply a "summation" aggregation function to the given ColumnAlias
      Parameters:
      alias - a ColumnAlias to assign to the projection
      Returns:
      an AggregationColumn where "summation" is applied.
    • avg

      public static AggregationColumn avg(ColumnAlias alias)
      Apply a "average" aggregation function to the given ColumnAlias
      Parameters:
      alias - a ColumnAlias to assign to the projection
      Returns:
      an AggregationColumn where "average" is applied.
    • count

      public static AggregationColumn count(ColumnAlias alias)
      Apply a "count" aggregation function to the given ColumnAlias
      Parameters:
      alias - a ColumnAlias to assign to the projection
      Returns:
      an AggregationColumn where "count" is applied.
    • min

      public static AggregationColumn min(ColumnAlias alias)
      Apply a "minimum" aggregation function to the given ColumnAlias
      Parameters:
      alias - a ColumnAlias to assign to the projection
      Returns:
      an AggregationColumn where "minimum" is applied.
    • max

      public static AggregationColumn max(ColumnAlias alias)
      Apply a "maximum" aggregation function to the given ColumnAlias
      Parameters:
      alias - a ColumnAlias to assign to the projection
      Returns:
      an AggregationColumn where "maximum" is applied.
    • sum

      public static AggregationColumn sum(String c, String alias)
      Apply a "summation" aggregation function to the given field name. This projection can be referred to by the given alias.
      Parameters:
      c - field name
      alias - an alias name to assign to the projection
      Returns:
      an AggregationColumn where "summation" is applied.
    • avg

      public static AggregationColumn avg(String c, String alias)
      Apply a "average" aggregation function to the given field name. This projection can be referred to by the given alias.
      Parameters:
      c - field name
      alias - an alias name to assign to the projection
      Returns:
      an AggregationColumn where "average" is applied.
    • count

      public static AggregationColumn count(String c, String alias)
      Apply a "count" aggregation function to the given field name. This projection can be referred to by the given alias.
      Parameters:
      c - field name
      alias - an alias name to assign to the projection
      Returns:
      an AggregationColumn where "count" is applied.
    • min

      public static AggregationColumn min(String c, String alias)
      Apply a "minimum" aggregation function to the given field name. This projection can be referred to by the given alias.
      Parameters:
      c - field name
      alias - an alias name to assign to the projection
      Returns:
      an AggregationColumn where "minimum" is applied.
    • max

      public static AggregationColumn max(String c, String alias)
      Apply a "maximum" aggregation function to the given field name. This projection can be referred to by the given alias.
      Parameters:
      c - field name
      alias - an alias name to assign to the projection
      Returns:
      an AggregationColumn where "maximum" is applied.
    • sum

      public static AggregationColumn sum(String c, String alias, boolean visibility)
      Apply a "summation" aggregation function to the given field name. This projection can be referred to by the given alias.
      Parameters:
      c - field name
      alias - an alias name to assign to the projection
      visibility - if true the projection will be visible; otherwise it will be hidden
      Returns:
      an AggregationColumn where "summation" is applied.
    • avg

      public static AggregationColumn avg(String c, String alias, boolean visibility)
      Apply a "average" aggregation function to the given field name. This projection can be referred to by the given alias.
      Parameters:
      c - field name
      alias - an alias name to assign to the projection
      visibility - if true the projection will be visible; otherwise it will be hidden
      Returns:
      an AggregationColumn where "average" is applied.
    • count

      public static AggregationColumn count(String c, String alias, boolean visibility)
      Apply a "count" aggregation function to the given field name. This projection can be referred to by the given alias.
      Parameters:
      c - field name
      alias - an alias name to assign to the projection
      visibility - if true the projection will be visible; otherwise it will be hidden
      Returns:
      an AggregationColumn where "count" is applied.
    • min

      public static AggregationColumn min(String c, String alias, boolean visibility)
      Apply a "minimum" aggregation function to the given field name. This projection can be referred to by the given alias.
      Parameters:
      c - field name
      alias - an alias name to assign to the projection
      visibility - if true the projection will be visible; otherwise it will be hidden
      Returns:
      an AggregationColumn where "minimum" is applied.
    • max

      public static AggregationColumn max(String c, String alias, boolean visibility)
      Apply a "maximum" aggregation function to the given field name. This projection can be referred to by the given alias.
      Parameters:
      c - field name
      alias - an alias name to assign to the projection
      visibility - if true the projection will be visible; otherwise it will be hidden
      Returns:
      an AggregationColumn where "maximum" is applied.
    • sum

      public static AggregationColumn sum(ColumnAlias alias, boolean visibility)
      Apply a "summation" aggregation function to the given ColumnAlias. This projection can be referred to by the given alias.
      Parameters:
      alias - a ColumnAlias to assign to the projection
      visibility - if true the projection will be visible; otherwise it will be hidden
      Returns:
      an AggregationColumn where "summation" is applied.
    • avg

      public static AggregationColumn avg(ColumnAlias alias, boolean visibility)
      Apply a "average" aggregation function to the given ColumnAlias. This projection can be referred to by the given alias.
      Parameters:
      alias - a ColumnAlias to assign to the projection
      visibility - if true the projection will be visible; otherwise it will be hidden
      Returns:
      an AggregationColumn where "average" is applied.
    • count

      public static AggregationColumn count(ColumnAlias alias, boolean visibility)
      Apply a "count" aggregation function to the given ColumnAlias. This projection can be referred to by the given alias.
      Parameters:
      alias - a ColumnAlias to assign to the projection
      visibility - if true the projection will be visible; otherwise it will be hidden
      Returns:
      an AggregationColumn where "count" is applied.
    • min

      public static AggregationColumn min(ColumnAlias alias, boolean visibility)
      Apply a "minimum" aggregation function to the given ColumnAlias. This projection can be referred to by the given alias.
      Parameters:
      alias - a ColumnAlias to assign to the projection
      visibility - if true the projection will be visible; otherwise it will be hidden
      Returns:
      an AggregationColumn where "minimum" is applied.
    • max

      public static AggregationColumn max(ColumnAlias alias, boolean visibility)
      Apply a "maximum" aggregation function to the given ColumnAlias. This projection can be referred to by the given alias.
      Parameters:
      alias - a ColumnAlias to assign to the projection
      visibility - if true the projection will be visible; otherwise it will be hidden
      Returns:
      an AggregationColumn where "maximum" is applied.
    • sum

      public static AggregationColumn sum(Column c)
      Apply a "summation" aggregation function to the given Column
      Parameters:
      c - a Column
      Returns:
      an AggregationColumn where "summation" is applied.
    • avg

      public static AggregationColumn avg(Column c)
      Apply a "average" aggregation function to the given Column
      Parameters:
      c - a Column
      Returns:
      an AggregationColumn where "average" is applied.
    • count

      public static AggregationColumn count(Column c)
      Apply a "count" aggregation function to the given Column
      Parameters:
      c - a Column
      Returns:
      an AggregationColumn where "count" is applied.
    • min

      public static AggregationColumn min(Column c)
      Apply a "minimum" aggregation function to the given Column
      Parameters:
      c - a Column
      Returns:
      an AggregationColumn where "minimum" is applied.
    • max

      public static AggregationColumn max(Column c)
      Apply a "maximum" aggregation function to the given Column
      Parameters:
      c - a Column
      Returns:
      an AggregationColumn where "maximum" is applied.