Package edu.ie3.datamodel.io.factory
Class EntityData
java.lang.Object
edu.ie3.datamodel.io.factory.FactoryData
edu.ie3.datamodel.io.factory.EntityData
- Direct Known Subclasses:
AssetInputEntityData
,LineGraphicInputEntityData
,NodeGraphicInputEntityData
,SimpleEntityData
Internal API Contains data that is needed by an
EntityFactory
to generate an entity- Since:
- 28.01.20
-
Constructor Summary
ModifierConstructorDescriptionprotected
EntityData
(Map<String, String> fieldsToAttributes, Class<? extends UniqueEntity> entityClass) Creates a new EntityData object -
Method Summary
Modifier and TypeMethodDescriptionboolean
getBoolean
(String field) Returns boolean value for given field name.Optional<org.locationtech.jts.geom.LineString>
getLineString
(String field) Parses and returns a geometrical LineString from field value of given field name.Optional<org.locationtech.jts.geom.Point>
Parses and returns a geometrical Point from field value of given field name.Class<? extends UniqueEntity>
getVoltageLvl
(String voltLvlField, String ratedVoltField) Parses and returns a voltage level from field value of given field name.toString()
Methods inherited from class edu.ie3.datamodel.io.factory.FactoryData
containsKey, equals, getDouble, getField, getFieldOptional, getFieldsToValues, getInt, getQuantity, getUUID, getUUIDs, hashCode
-
Constructor Details
-
EntityData
protected EntityData(Map<String, String> fieldsToAttributes, Class<? extends UniqueEntity> entityClass) Creates a new EntityData object- Parameters:
fieldsToAttributes
- attribute map: field name to valueentityClass
- class of the entity to be created with this data
-
-
Method Details
-
getTargetClass
- Overrides:
getTargetClass
in classFactoryData
-
getBoolean
Returns boolean value for given field name. ThrowsFactoryException
if field does not exist, or field value is null or empty.- Parameters:
field
- field name- Returns:
- true if value is "1" or "true", false otherwise
-
getLineString
Parses and returns a geometrical LineString from field value of given field name. ThrowsFactoryException
if field does not exist or parsing fails.- Parameters:
field
- field name- Returns:
- LineString if field value is not empty, empty Optional otherwise
-
getPoint
Parses and returns a geometrical Point from field value of given field name. ThrowsFactoryException
if field does not exist or parsing fails.- Parameters:
field
- field name- Returns:
- Point if field value is not empty, empty Optional otherwise
-
getVoltageLvl
Parses and returns a voltage level from field value of given field name. ThrowsFactoryException
if field does not exist or parsing fails.- Parameters:
voltLvlField
- name of the field containing the voltage levelratedVoltField
- name of the field containing the rated voltage- Returns:
- Voltage level
-
toString
- Overrides:
toString
in classFactoryData
-