com.holonplatform.core.internal

## Class DefaultCollectionConstantExpression<E>

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractList<E>
    - - java.util.ArrayList<E>
      - - com.holonplatform.core.internal.DefaultCollectionConstantExpression<E>

- Type Parameters:
    `E` - List elements type
  All Implemented Interfaces:
    CollectionConstantExpression<E>, ConstantConverterExpression<Collection<E>,E>, ConverterExpression<E>, Expression, TypedExpression<E>, Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess

      public class DefaultCollectionConstantExpression<E>
      extends ArrayList<E>
      implements CollectionConstantExpression<E>

  Default `CollectionConstantExpression` implementation.
  Since:
    5.0.0
  See Also:
    Serialized Form

- - ### 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
    `DefaultCollectionConstantExpression(Collection<? extends E> values)` Constructor with a collection of values.
    `DefaultCollectionConstantExpression(E... values)` Constructor with an array of values.
    `DefaultCollectionConstantExpression(TypedExpression<E> expression, Collection<? extends E> values)` Constructor with a collection of values.
    `DefaultCollectionConstantExpression(TypedExpression<E> expression, E... values)` Constructor with an array of values.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Optional<ExpressionValueConverter<E,?>>` | `getExpressionValueConverter()` Get the expression value type converter, if available.
    `Collection<?>` | `getModelValue()` Get the model data type value, using the `ExpressionValueConverter` to convert constant expression value, if available.
    `Optional<TemporalType>` | `getTemporalType()` If the expression type represents a temporal type, get the actual `TemporalType` of the type.
    `Class<? extends E>` | `getType()` Get the expression type.
    `List<E>` | `getValue()` Get the constant expression value
    `void` | `setTemporalType(TemporalType temporalType)` Set the expression value temporal type.
    `String` | `toString()`
    `void` | `validate()` Validate this expression.

    - ### Methods inherited from class java.util.ArrayList

      `add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize`

    - ### Methods inherited from class java.util.AbstractList

      `equals, hashCode`

    - ### Methods inherited from class java.util.AbstractCollection

      `containsAll`

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

      `getClass, notify, notifyAll, wait, wait, wait`

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

      `create, create, create, create, hasValues`

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

      `create`

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

      `getModelType, getModelValue`

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

      `isCollectionExpression, isConverterExpression`

    - ### Methods inherited from interface java.util.List

      `containsAll, equals, hashCode`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, stream`

- - ### Constructor Detail

    - #### DefaultCollectionConstantExpression

          public DefaultCollectionConstantExpression(Collection<? extends E> values)

      Constructor with a collection of values.
      Parameters:
        `values` - Constant expression values

    - #### DefaultCollectionConstantExpression

          @SafeVarargs
          public DefaultCollectionConstantExpression(E... values)

      Constructor with an array of values.
      Parameters:
        `values` - Constant expression values

    - #### DefaultCollectionConstantExpression

          @SafeVarargs
          public DefaultCollectionConstantExpression(TypedExpression<E> expression,
                                                                   E... values)

      Constructor with an array of values.
      Parameters:
        `expression` - Optional expression from which to inherit an `ExpressionValueConverter`, if available.
        `values` - Constant expression values

    - #### DefaultCollectionConstantExpression

          public DefaultCollectionConstantExpression(TypedExpression<E> expression,
                                                     Collection<? extends E> values)

      Constructor with a collection of values.
      Parameters:
        `expression` - Optional expression from which to inherit an `ExpressionValueConverter`, if available.
        `values` - Constant expression values

  - ### Method Detail

    - #### getValue

          public List<E> getValue()

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

    - #### getModelValue

          public Collection<?> 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 `CollectionConstantExpression<E>`
      Specified by:
        `getModelValue` in interface `ConstantConverterExpression<Collection<E>,E>`
      Returns:
        The model-converted expression value if an `ExpressionValueConverter` is available, otherwise `ConstantConverterExpression.getValue()` is returned.

    - #### getExpressionValueConverter

          public Optional<ExpressionValueConverter<E,?>> getExpressionValueConverter()

      Description copied from interface: `ConverterExpression`
      Get the expression value type converter, if available.
      Specified by:
        `getExpressionValueConverter` in interface `ConverterExpression<E>`
      Returns:
        Optional `ExpressionValueConverter`

    - #### 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

    - #### getType

          public Class<? extends E> getType()

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

    - #### setTemporalType

          public void setTemporalType(TemporalType temporalType)

      Set the expression value temporal type.
      Parameters:
        `temporalType` - the temporal type to set

    - #### getTemporalType

          public Optional<TemporalType> getTemporalType()

      Description copied from interface: `TypedExpression`
      If the expression type represents a temporal type, get the actual `TemporalType` of the type.
      Specified by:
        `getTemporalType` in interface `TypedExpression<E>`
      Returns:
        Optional temporal type

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `AbstractCollection<E>`

Copyright © 2019 The Holon Platform. All rights reserved.