org.qi4j.library.conversion.values
Interface EntityToValue

All Known Subinterfaces:
EntityToValueService
All Known Implementing Classes:
EntityToValue.EntityToValueMixin

@Mixins(value=EntityToValue.EntityToValueMixin.class)
public interface EntityToValue


Nested Class Summary
static class 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.
 

Method Detail

convert

<T> T convert(java.lang.Class<T> valueType,
              java.lang.Object entity)
Convert an entity to a value.

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

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

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

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

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

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

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