com.holonplatform.core.internal

## Class DefaultConstantConverterExpression<T>

- java.lang.Object
- - com.holonplatform.core.internal.AbstractConverterExpression<T>
  - - com.holonplatform.core.internal.DefaultConstantConverterExpression<T>

- Type Parameters:
    `T` - Expression and value type
  All Implemented Interfaces:
    ConstantConverterExpression<T,T>, ConverterExpression<T>, Expression, TypedExpression<T>

      public class DefaultConstantConverterExpression<T>
      extends AbstractConverterExpression<T>
      implements ConstantConverterExpression<T,T>

  Default `ConstantConverterExpression` implementation.
  Since:
    5.2.0

- - ### Nested Class Summary

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

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultConstantConverterExpression(T value, Class<? extends T> type)` Constructor.
    `DefaultConstantConverterExpression(T value, Class<? extends T> type, ExpressionValueConverter<T,?> expressionValueConverter)` Constructor.
    `DefaultConstantConverterExpression(TypedExpression<T> expression, T value)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getModelValue()` Get the model data type value, using the `ExpressionValueConverter` to convert constant expression value, if available.
    `Class<? extends T>` | `getType()` Get the expression type.
    `T` | `getValue()` Get the constant expression value
    `String` | `toString()`
    `void` | `validate()` Validate this expression.

    - ### Methods inherited from class com.holonplatform.core.internal.AbstractConverterExpression

      `getExpressionValueConverter, getTemporalType, setTemporalType`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

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

      `create, create, create`

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

      `getExpressionValueConverter, getModelType, getModelValue`

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

      `getTemporalType, isCollectionExpression, isConverterExpression`

- - ### Constructor Detail

    - #### DefaultConstantConverterExpression

          public DefaultConstantConverterExpression(T value,
                                                    Class<? extends T> type)

      Constructor.
      Parameters:
        `value` - Constant value
        `type` - Value type

    - #### DefaultConstantConverterExpression

          public DefaultConstantConverterExpression(T value,
                                                    Class<? extends T> type,
                                                    ExpressionValueConverter<T,?> expressionValueConverter)

      Constructor.
      Parameters:
        `value` - Constant value
        `type` - Value type
        `expressionValueConverter` - Expression value converter (may be null)

    - #### DefaultConstantConverterExpression

          public DefaultConstantConverterExpression(TypedExpression<T> expression,
                                                    T value)

      Constructor
      Parameters:
        `expression` - Expression from which to inherit an `ExpressionValueConverter`, if available (not null)
        `value` - Constant value

  - ### Method Detail

    - #### getType

          public Class<? extends T> getType()

      Description copied from interface: `TypedExpression`
      Get the expression type.
      Specified by:
        `getType` in interface `TypedExpression<T>`
      Returns:
        Expression type

    - #### getValue

          public T getValue()

      Description copied from interface: `ConstantConverterExpression`
      Get the constant expression value
      Specified by:
        `getValue` in interface `ConstantConverterExpression<T,T>`
      Returns:
        The expression value

    - #### getModelValue

          public Object getModelValue()

      Description copied from interface: `ConstantConverterExpression`
      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.
      Specified by:
        `getModelValue` in interface `ConstantConverterExpression<T,T>`
      Returns:
        The model-converted expression value if an `ExpressionValueConverter` is available, otherwise `ConstantConverterExpression.getValue()` is returned.

    - #### validate

          public void validate()
                        throws Expression.InvalidExpressionException

      Description copied from interface: `Expression`
      Validate this expression.
      Specified by:
        `validate` in interface `Expression`
      Throws:
        `Expression.InvalidExpressionException` - If the expression is not valid

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2019 The Holon Platform. All rights reserved.