Class EntityProcessor<T extends UniqueEntity>

java.lang.Object
edu.ie3.datamodel.io.processor.Processor<T>
edu.ie3.datamodel.io.processor.EntityProcessor<T>
Direct Known Subclasses:
InputEntityProcessor, ResultEntityProcessor, TimeSeriesProcessor

public abstract class EntityProcessor<T extends UniqueEntity> extends Processor<T>
Internal API Interface for EntityProcessors. Main purpose is to 'serialize' models into a fieldName to value representation to allow for an easy processing into a database or file sink e.g. .csv
Since:
31.01.20
  • Field Details

    • log

      public static final org.slf4j.Logger log
    • headerElements

      protected final String[] headerElements
  • Constructor Details

    • EntityProcessor

      protected EntityProcessor(Class<? extends T> registeredClass)
      Create a new EntityProcessor
      Parameters:
      registeredClass - the class the entity processor should be able to handle
  • Method Details

    • handleEntity

      public Optional<LinkedHashMap<String,String>> handleEntity(T entity)
      Standard call to handle an entity
      Parameters:
      entity - the entity that should be 'serialized' into a map of fieldName to fieldValue
      Returns:
      an optional Map with fieldName to fieldValue or an empty optional if an error occurred during processing
    • handleProcessorSpecificQuantity

      protected Optional<String> handleProcessorSpecificQuantity(javax.measure.Quantity<?> quantity, String fieldName)
      Description copied from class: Processor
      This method should handle all quantities that are model processor specific e.g. we need to handle active power p different for ResultEntitys and SystemParticipantInputs Hence from the generalized method Processor.handleQuantity(Quantity, String), this allows for the specific handling of child implementations. See the implementation @ ResultEntityProcessor for details.
      Specified by:
      handleProcessorSpecificQuantity in class Processor<T extends UniqueEntity>
      Parameters:
      quantity - the quantity that should be processed
      fieldName - the field name the quantity is set to
      Returns:
      an optional string with the normalized to StandardUnits value of the quantity or empty if an error occurred during processing
    • getHeaderElements

      public String[] getHeaderElements()
      Description copied from class: Processor
      Return all header elements of the table
      Specified by:
      getHeaderElements in class Processor<T extends UniqueEntity>
      Returns:
      all header elements of the table