com.holonplatform.core.query

## Interface FunctionExpression<T>

- Type Parameters:
    `T` - Function result, expression and projection type
  All Superinterfaces:
    Expression, QueryExpression<T>, QueryProjection<T>
  All Known Subinterfaces:
    FunctionExpression.FunctionExpressionProperty<T>, FunctionExpression.PathFunctionExpression<P,T>, FunctionExpression.PathFunctionExpressionProperty<P,T>

      public interface FunctionExpression<T>
      extends QueryExpression<T>, QueryProjection<T>

  A `QueryExpression` wich represents the result of a `QueryFunction` a can be used as `QueryProjection`.
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `FunctionExpression.FunctionExpressionProperty<T>` A `FunctionExpression` implemented as a `Property`.
    `static interface` | `FunctionExpression.PathFunctionExpression<P,T>` A `FunctionExpression` which acts on a `Path`.
    `static interface` | `FunctionExpression.PathFunctionExpressionProperty<P,T>` A `FunctionExpression.PathFunctionExpression` implemented as a `VirtualProperty`.

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.Expression

      `Expression.ExpressionResolverFunction<E extends Expression,R extends Expression>, Expression.InvalidExpressionException`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> FunctionExpression.PathFunctionExpression<T,Double>` | `avg(Path<T> path)` Create a function expression which represents the `QueryFunction.Avg` aggregation function on given `path`.
    `static <T> FunctionExpression.PathFunctionExpression<T,Long>` | `count(Path<T> path)` Create a function expression which represents the `QueryFunction.Count` aggregation function on given `path`.
    `static <T> FunctionExpression<T>` | `create(QueryFunction<T> function)` Create a new `FunctionExpression` using given `function`.
    `QueryFunction<T>` | `getFunction()` Get the `QueryFunction` associated with this expression.
    `static <T> FunctionExpression.PathFunctionExpression<T,T>` | `max(Path<T> path)` Create a function expression which represents the `QueryFunction.Max` aggregation function on given `path`.
    `static <T> FunctionExpression.PathFunctionExpression<T,T>` | `min(Path<T> path)` Create a function expression which represents the `QueryFunction.Min` aggregation function on given `path`.
    `static <T> FunctionExpression.PathFunctionExpression<T,T>` | `sum(Path<T> path)` Create a function expression which represents the `QueryFunction.Max` aggregation function on given `path`.

    - ### Methods inherited from interface com.holonplatform.core.query.QueryExpression

      `getType`

    - ### Methods inherited from interface com.holonplatform.core.query.QueryProjection

      `getType`

    - ### Methods inherited from interface com.holonplatform.core.Expression

      `validate`

- - ### Method Detail

    - #### getFunction

          QueryFunction<T> getFunction()

      Get the `QueryFunction` associated with this expression.
      Returns:
        Expression function

    - #### create

          static <T> FunctionExpression<T> create(QueryFunction<T> function)

      Create a new `FunctionExpression` using given `function`.
      Type Parameters:
        `T` - Function type
      Parameters:
        `function` - Expression function (not null)
      Returns:
        A new `FunctionExpression` associated with given query function

    - #### count

          static <T> FunctionExpression.PathFunctionExpression<T,Long> count(Path<T> path)

      Create a function expression which represents the `QueryFunction.Count` aggregation function on given `path`.

      With the count aggregation function, the query expression and projection type is of `Long` type.

      Type Parameters:
        `T` - Path type
      Parameters:
        `path` - Path to which to apply the function
      Returns:
        A new `FunctionExpression.PathFunctionExpression`

    - #### avg

          static <T> FunctionExpression.PathFunctionExpression<T,Double> avg(Path<T> path)

      Create a function expression which represents the `QueryFunction.Avg` aggregation function on given `path`.

      With the avg aggregation function, the query expression and projection type is of `Double` type.

      Type Parameters:
        `T` - Path type
      Parameters:
        `path` - Path to which to apply the function
      Returns:
        A new `FunctionExpression.PathFunctionExpression`

    - #### min

          static <T> FunctionExpression.PathFunctionExpression<T,T> min(Path<T> path)

      Create a function expression which represents the `QueryFunction.Min` aggregation function on given `path`.
      Type Parameters:
        `T` - Path type
      Parameters:
        `path` - Path to which to apply the function
      Returns:
        A new `FunctionExpression.PathFunctionExpression`

    - #### max

          static <T> FunctionExpression.PathFunctionExpression<T,T> max(Path<T> path)

      Create a function expression which represents the `QueryFunction.Max` aggregation function on given `path`.
      Type Parameters:
        `T` - Path type
      Parameters:
        `path` - Path to which to apply the function
      Returns:
        A new `FunctionExpression.PathFunctionExpression`

    - #### sum

          static <T> FunctionExpression.PathFunctionExpression<T,T> sum(Path<T> path)

      Create a function expression which represents the `QueryFunction.Max` aggregation function on given `path`.
      Type Parameters:
        `T` - Path type
      Parameters:
        `path` - Path to which to apply the function
      Returns:
        A new `FunctionExpression.PathFunctionExpression`

Copyright © 2017 The Holon Platform. All rights reserved.