org.qi4j.library.conversion.values
Class EntityToValue.EntityToValueMixin

java.lang.Object
  extended by org.qi4j.library.conversion.values.EntityToValue.EntityToValueMixin
All Implemented Interfaces:
EntityToValue
Enclosing interface:
EntityToValue

public static class EntityToValue.EntityToValueMixin
extends java.lang.Object
implements EntityToValue


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.qi4j.library.conversion.values.EntityToValue
EntityToValue.EntityToValueMixin
 
Constructor Summary
EntityToValue.EntityToValueMixin()
           
 
Method Summary
<T> java.lang.Iterable<T>
convert(java.lang.Class<T> valueType, java.lang.Iterable<java.lang.Object> entities)
          Convert an iterable of entities to an iterable of values.
<T> java.lang.Iterable<T>
convert(java.lang.Class<T> valueType, java.lang.Iterable<java.lang.Object> entities, Function<T,T> prototypeOpportunity)
          Convert an iterable of entities to an iterable of values with an opportunity to customize their prototypes.
<T> T
convert(java.lang.Class<T> valueType, java.lang.Object entity)
          Convert an entity to a value.
<T> T
convert(java.lang.Class<T> valueType, java.lang.Object entity, Function<T,T> prototypeOpportunity)
          Convert an entity to a value with an opportunity to customize its prototype.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityToValue.EntityToValueMixin

public EntityToValue.EntityToValueMixin()
Method Detail

convert

public <T> T convert(java.lang.Class<T> valueType,
                     java.lang.Object entity)
Description copied from interface: EntityToValue
Convert an entity to a value.

Specified by:
convert in interface EntityToValue
Type Parameters:
T - parametrized type of the value
Parameters:
valueType - type of the value
entity - the entity to convert to a value
Returns:
the resulting value

convert

public <T> T convert(java.lang.Class<T> valueType,
                     java.lang.Object entity,
                     Function<T,T> prototypeOpportunity)
Description copied from interface: EntityToValue
Convert an entity to a value with an opportunity to customize its prototype.

Specified by:
convert in interface EntityToValue
Type Parameters:
T - parametrized type of the value
Parameters:
valueType - type of the value
entity - the entity to convert to a value
prototypeOpportunity - a Function that will be mapped on the value prototype before instanciantion
Returns:
the resulting value

convert

public <T> java.lang.Iterable<T> convert(java.lang.Class<T> valueType,
                                         java.lang.Iterable<java.lang.Object> entities)
Description copied from interface: EntityToValue
Convert an iterable of entities to an iterable of values.

Specified by:
convert in interface EntityToValue
Type Parameters:
T - parametrized type of the value
Parameters:
valueType - type of the value
entities - the entities to convert to values
Returns:
the resulting values

convert

public <T> java.lang.Iterable<T> convert(java.lang.Class<T> valueType,
                                         java.lang.Iterable<java.lang.Object> entities,
                                         Function<T,T> prototypeOpportunity)
Description copied from interface: EntityToValue
Convert an iterable of entities to an iterable of values with an opportunity to customize their prototypes.

Specified by:
convert in interface EntityToValue
Type Parameters:
T - parametrized type of the value
Parameters:
valueType - type of the value
entities - the entities to convert to values
prototypeOpportunity - a Function that will be mapped on each of the value prototypes before instanciation.
Returns:
the resulting values