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
private static class DataMapper.MapperEntry<T> extends java.lang.ObjectImplements a mapper entry forMappingConsumer.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.Methodgetterprivate java.util.function.Consumer<java.lang.Object>translator
-
Constructor Summary
Constructors Modifier Constructor Description privateMapperEntry(java.lang.reflect.Method getter)Creates a mapper entry for a given reflection getter method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanaccept(T instance)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.private <A> voidsetConsumer(java.lang.Class<A> cls, java.util.function.Consumer<A> consumer)Sets a configurable consumer for a given type.
-
-
-
Method Detail
-
setConsumer
private <A> void setConsumer(java.lang.Class<A> cls, java.util.function.Consumer<A> consumer)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
private boolean accept(T instance)
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
-
-