Class DataMapper.MappingConsumer<T>
- java.lang.Object
-
- de.iip_ecosphere.platform.services.environment.DataMapper.MappingConsumer<T>
-
- Type Parameters:
T- the mapped type
- All Implemented Interfaces:
java.util.function.Consumer<T>
- Direct Known Subclasses:
DataMapper.BaseMappingConsumer
- Enclosing class:
- DataMapper
public static class DataMapper.MappingConsumer<T> extends java.lang.Object implements java.util.function.Consumer<T>Provides a default consumer implementation forDataMapper.mapJsonData(InputStream, Class, Consumer)which maps attribute values to registered consumers.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.Class<?>,DataMapper.MapperEntry<T>>mapping
-
Constructor Summary
Constructors Constructor Description MappingConsumer(java.lang.Class<T> cls)Creates a mapping consumer for the givenclstype.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(T value)<A> voidaddHandler(java.lang.Class<A> cls, java.util.function.Consumer<A> cons)Adds a handler forclsbased on the consumercons.
-
-
-
Field Detail
-
mapping
private java.util.Map<java.lang.Class<?>,DataMapper.MapperEntry<T>> mapping
-
-
Constructor Detail
-
MappingConsumer
public MappingConsumer(java.lang.Class<T> cls)
Creates a mapping consumer for the givenclstype.- Parameters:
cls- the class to do the mapping for
-
-
Method Detail
-
addHandler
public <A> void addHandler(java.lang.Class<A> cls, java.util.function.Consumer<A> cons)Adds a handler forclsbased on the consumercons.- Type Parameters:
A- the data type to be handled- Parameters:
cls- the class to handle (may be null, then this call is ignored)cons- the corresponding consumer (may be null, then this call is ignored)
-
-