org.qi4j.library.conversion.values

## Interface ValueToEntity

- All Known Subinterfaces:
    ValueToEntityService
  All Known Implementing Classes:
    ValueToEntityMixin

  Deprecated.
  Please use `UnitOfWork.toEntity(Class, Identity)` instead.

      public interface ValueToEntity

  Create or update Entities from matching Values.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> Iterable<T>` | `create(Class<T> entityType, Iterable<Object> values)` Deprecated. Create an Iterable of Entities from an Iterable of Values.
    `<T> Iterable<T>` | `create(Class<T> entityType, Iterable<Object> values, Function<T,T> prototypeOpportunity)` Deprecated. Create an Iterable of Entities from an Iterable of Values.
    `<T> T` | `create(Class<T> entityType, Object value)` Deprecated. Create an Entity from a Value.
    `<T> T` | `create(Class<T> entityType, Object value, Function<T,T> prototypeOpportunity)` Deprecated. Create an Entity from a Value.
    `<T> T` | `create(Class<T> entityType, String identity, Object value)` Deprecated. Create an Entity from a Value.
    `<T> T` | `create(Class<T> entityType, String identity, Object value, Function<T,T> prototypeOpportunity)` Deprecated. Create an Entity from a Value.
    `void` | `update(Object entity, Object value)` Deprecated. Update an Entity from a Value.

- - ### Method Detail

    - #### create

          <T> T create(Class<T> entityType,
                     Object value)

      Deprecated.
      Create an Entity from a Value.

      If the Value extends `Identity` the Entity identity is taken from the Value's state. Else, if the Value's state for `Identity` is absent, a new Identity is generated.

      Type Parameters:
        `T` - Value Type
      Parameters:
        `entityType` - Entity Type
        `value` - Value
      Returns:
        the created Entity

    - #### create

          <T> T create(Class<T> entityType,
                     String identity,
                     Object value)

      Deprecated.
      Create an Entity from a Value.

      If `identity` is not null, it is used as Entity identity. Else, if the Value extends `Identity` the Entity identity is taken from the Value's state. Else, if the Value's state for `Identity` is absent, a new Identity is generated.

      Type Parameters:
        `T` - Value Type
      Parameters:
        `entityType` - Entity Type
        `identity` - Entity Identity, may be null
        `value` - Value
      Returns:
        the created Entity

    - #### create

          <T> T create(Class<T> entityType,
                     Object value,
                     Function<T,T> prototypeOpportunity)

      Deprecated.
      Create an Entity from a Value.

      If the Value extends `Identity` the Entity identity is taken from the Value's state. Else, if the Value's state for `Identity` is absent, a new Identity is generated.

      Type Parameters:
        `T` - Value Type
      Parameters:
        `entityType` - Entity Type
        `value` - Value
        `prototypeOpportunity` - A Function that will be mapped on the Entity prototype before instanciation
      Returns:
        the created Entity

    - #### create

          <T> T create(Class<T> entityType,
                     String identity,
                     Object value,
                     Function<T,T> prototypeOpportunity)

      Deprecated.
      Create an Entity from a Value.

      If `identity` is not null, it is used as Entity identity. Else, if the Value extends `Identity` the Entity identity is taken from the Value's state. Else, if the Value's state for `Identity` is absent, a new Identity is generated.

      Type Parameters:
        `T` - Value Type
      Parameters:
        `entityType` - Entity Type
        `identity` - Entity Identity, may be null
        `value` - Value
        `prototypeOpportunity` - A Function that will be mapped on the Entity prototype before instanciation
      Returns:
        the created Entity

    - #### create

          <T> Iterable<T> create(Class<T> entityType,
                               Iterable<Object> values)

      Deprecated.
      Create an Iterable of Entities from an Iterable of Values.

      If a Value extends `Identity` the Entity identity is taken from the Value's state. Else, if a Value's state for `Identity` is absent, a new Identity is generated.

      Type Parameters:
        `T` - Value Type
      Parameters:
        `entityType` - Entity Type
        `values` - An Iterable of Values
      Returns:
        the Iterable of created Entities

    - #### create

          <T> Iterable<T> create(Class<T> entityType,
                               Iterable<Object> values,
                               Function<T,T> prototypeOpportunity)

      Deprecated.
      Create an Iterable of Entities from an Iterable of Values.

      If a Value extends `Identity` the Entity identity is taken from the Value's state. Else, if a Value's state for `Identity` is absent, a new Identity is generated.

      Type Parameters:
        `T` - Value Type
      Parameters:
        `entityType` - Entity Type
        `values` - An Iterable of Values
        `prototypeOpportunity` - A Function that will be mapped on each Entity prototype before instanciation
      Returns:
        the Iterable of created Entities

    - #### update

          void update(Object entity,
                    Object value)
                      throws ClassCastException,
                             NoSuchEntityException

      Deprecated.
      Update an Entity from a Value.
      Parameters:
        `entity` - Entity
        `value` - Value
      Throws:
        `ClassCastException` - If `entity` is not an `EntityComposite` or if `value` is not a `ValueComposite`
        `NoSuchEntityException` - If some associated Entity is absent from the EntityStore/UoW