com.holonplatform.core

## Interface ConstantConverterExpression<T,E>

- Type Parameters:
    `T` - Expression type
    `E` - Constant value type
  All Superinterfaces:
    ConverterExpression<E>, Expression, TypedExpression<E>
  All Known Subinterfaces:
    CollectionConstantExpression<T>, ConstantExpression<T>
  All Known Implementing Classes:
    DefaultCollectionConstantExpression, DefaultConstantConverterExpression

      public interface ConstantConverterExpression<T,E>
      extends ConverterExpression<E>

  An expression which represents a constant value and supports value conversion using an `ExpressionValueConverter`.
  Since:
    5.1.0

- - ### Nested Class Summary

    - ### 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> ConstantConverterExpression<T,T>` | `create(T value)` Create a `ConstantConverterExpression` which represents a constant value, deriving the expression type from the value class.
    `static <T> ConstantConverterExpression<T,T>` | `create(T value, Class<? extends T> type)` Create a `ConstantConverterExpression` which represents a constant value.
    `static <T> ConstantConverterExpression<T,T>` | `create(TypedExpression<T> expression, T value)` Create a `ConstantConverterExpression` which represents a constant value, using given `expression` to inherit an `ExpressionValueConverter`, if available.
    `Object` | `getModelValue()` Get the model data type value, using the `ExpressionValueConverter` to convert constant expression value, if available.
    `T` | `getValue()` Get the constant expression value

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

      `getExpressionValueConverter, getModelType, getModelValue`

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

      `getTemporalType, getType, isCollectionExpression, isConverterExpression`

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

      `validate`

- - ### Method Detail

    - #### getValue

          T getValue()

      Get the constant expression value
      Returns:
        The expression value

    - #### getModelValue

          Object getModelValue()

      Get the model data type value, using the `ExpressionValueConverter` to convert constant expression value, if available. If an `ExpressionValueConverter` is not available, the original expression value is returned.
      Returns:
        The model-converted expression value if an `ExpressionValueConverter` is available, otherwise `getValue()` is returned.

    - #### create

          static <T> ConstantConverterExpression<T,T> create(T value)

      Create a `ConstantConverterExpression` which represents a constant value, deriving the expression type from the value class.
      Type Parameters:
        `T` - Expression and value type
      Parameters:
        `value` - Constant value (not null)
      Returns:
        A new `ConstantConverterExpression` instance

    - #### create

          static <T> ConstantConverterExpression<T,T> create(T value,
                                                             Class<? extends T> type)

      Create a `ConstantConverterExpression` which represents a constant value.
      Type Parameters:
        `T` - Expression and value type
      Parameters:
        `value` - Constant value
        `type` - Constant value type (not null)
      Returns:
        A new `ConstantConverterExpression` instance

    - #### create

          static <T> ConstantConverterExpression<T,T> create(TypedExpression<T> expression,
                                                             T value)

      Create a `ConstantConverterExpression` which represents a constant value, using given `expression` to inherit an `ExpressionValueConverter`, if available.
      Type Parameters:
        `T` - Expression and value type
      Parameters:
        `expression` - Expression form which to inherit an `ExpressionValueConverter`, if available (not null)
        `value` - Constant value
      Returns:
        A new `ConstantConverterExpression` instance

Copyright © 2019 The Holon Platform. All rights reserved.