Package edu.ie3.datamodel.io.processor
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
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 Summary
Fields inherited from class edu.ie3.datamodel.io.processor.Processor
logger, registeredClass
-
Constructor Summary
ModifierConstructorDescriptionprotected
EntityProcessor
(Class<? extends T> registeredClass) Create a new EntityProcessor -
Method Summary
Modifier and TypeMethodDescriptionString[]
Return all header elements of the tablehandleEntity
(T entity) Standard call to handle an entityhandleProcessorSpecificQuantity
(javax.measure.Quantity<?> quantity, String fieldName) This method should handle all quantities that are model processor specific e.g.Methods inherited from class edu.ie3.datamodel.io.processor.Processor
getEligibleEntityClasses, getRegisteredClass, handleQuantity, mapFieldNameToGetter, mapFieldNameToGetter, processMethodResult, processObject, processOperationTime, processUUIDArray, processVoltageLevel, processZonedDateTime, putUuidFirst, quantityValToOptionalString
-
Field Details
-
log
public static final org.slf4j.Logger log -
headerElements
-
-
Constructor Details
-
EntityProcessor
Create a new EntityProcessor- Parameters:
registeredClass
- the class the entity processor should be able to handle
-
-
Method Details
-
handleEntity
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 forResultEntity
s andSystemParticipantInput
s Hence from the generalized methodProcessor.handleQuantity(Quantity, String)
, this allows for the specific handling of child implementations. See the implementation @ResultEntityProcessor
for details.- Specified by:
handleProcessorSpecificQuantity
in classProcessor<T extends UniqueEntity>
- Parameters:
quantity
- the quantity that should be processedfieldName
- 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
Description copied from class:Processor
Return all header elements of the table- Specified by:
getHeaderElements
in classProcessor<T extends UniqueEntity>
- Returns:
- all header elements of the table
-