com.holonplatform.core

## Interface ExpressionValueConverter<TYPE,MODEL>

- Type Parameters:
    `TYPE` - Expression type
    `MODEL` - Model type

      public interface ExpressionValueConverter<TYPE,MODEL>

  The expression value converter associated to a `ConverterExpression`.
  Since:
    5.1.0

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `TYPE` | `fromModel(MODEL value)` Convert given value from model data type to expression value type.
    `static <TYPE> Optional<ExpressionValueConverter<TYPE,?>>` | `fromProperty(Property<TYPE> property)` Create a new `ExpressionValueConverter` using given `property`.
    `Class<MODEL>` | `getModelType()` Get the model data type.
    `MODEL` | `toModel(TYPE value)` Convert given value from expression value type to model data type.

- - ### Method Detail

    - #### fromModel

          TYPE fromModel(MODEL value)

      Convert given value from model data type to expression value type.
      Parameters:
        `value` - Value to convert
      Returns:
        Value converted to expression value type

    - #### toModel

          MODEL toModel(TYPE value)

      Convert given value from expression value type to model data type.
      Parameters:
        `value` - Value to convert
      Returns:
        Value converted to model data type

    - #### getModelType

          Class<MODEL> getModelType()

      Get the model data type.
      Returns:
        Model data type

    - #### fromProperty

          static <TYPE> Optional<ExpressionValueConverter<TYPE,?>> fromProperty(Property<TYPE> property)

      Create a new `ExpressionValueConverter` using given `property`.
      Type Parameters:
        `TYPE` - Expression type
      Parameters:
        `property` - Property (not null)
      Returns:
        If the property provides a `PropertyValueConverter`, return an `ExpressionValueConverter` which uses the property value converter to perform conversions. Otherwise, an empty Optional is returned.

Copyright © 2019 The Holon Platform. All rights reserved.