Class DataMapper.MapperEntry<T>
java.lang.Object
de.iip_ecosphere.platform.services.environment.DataMapper.MapperEntry<T>
- Type Parameters:
T- the containing mapped type
- Enclosing class:
DataMapper
Implements a mapper entry for
MappingConsumer.- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMapperEntry(Method getter) Creates a mapper entry for a given reflection getter method. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanAccepts an instance of the mapped type by applying thegettertoinstanceand if the result of the invocation is not null, calls the registeredtranslatorto accept the value of thegettercall.private <A> voidsetConsumer(Class<A> cls, Consumer<A> consumer) Sets a configurable consumer for a given type.
-
Field Details
-
getter
-
translator
-
-
Constructor Details
-
MapperEntry
Creates a mapper entry for a given reflection getter method.- Parameters:
getter- the getter method
-
-
Method Details
-
setConsumer
Sets a configurable consumer for a given type. Exceptions are logged.- Type Parameters:
A- the type- Parameters:
cls- the type classconsumer- the consumer to be added
-
accept
Accepts an instance of the mapped type by applying thegettertoinstanceand if the result of the invocation is not null, calls the registeredtranslatorto accept the value of thegettercall. Exceptions are logged.- Parameters:
instance- the data instance to accept/process- Returns:
trueifinstancewas passed on to a translator,falseelse
-