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:
Consumer<T>
Direct Known Subclasses:
DataMapper.BaseMappingConsumer
Enclosing class:
DataMapper

public static class DataMapper.MappingConsumer<T> extends Object implements Consumer<T>
Provides a default consumer implementation for DataMapper.mapJsonData(InputStream, Class, Consumer) which maps attribute values to registered consumers.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • MappingConsumer

      public MappingConsumer(Class<T> cls)
      Creates a mapping consumer for the given cls type.
      Parameters:
      cls - the class to do the mapping for
  • Method Details

    • addHandler

      public <A> void addHandler(Class<A> cls, Consumer<A> cons)
      Adds a handler for cls based on the consumer cons.
      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)
    • accept

      public void accept(T value)
      Specified by:
      accept in interface Consumer<T>