Class EntityData

java.lang.Object
edu.ie3.datamodel.io.factory.FactoryData
edu.ie3.datamodel.io.factory.EntityData
Direct Known Subclasses:
AssetInputEntityData, LineGraphicInputEntityData, NodeGraphicInputEntityData, SimpleEntityData

public abstract class EntityData extends FactoryData
Internal API Contains data that is needed by an EntityFactory to generate an entity
Since:
28.01.20
  • 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 value
      entityClass - class of the entity to be created with this data
  • Method Details

    • getTargetClass

      public Class<? extends UniqueEntity> getTargetClass()
      Overrides:
      getTargetClass in class FactoryData
    • getBoolean

      public boolean getBoolean(String field)
      Returns boolean value for given field name. Throws FactoryException 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

      public Optional<org.locationtech.jts.geom.LineString> getLineString(String field)
      Parses and returns a geometrical LineString from field value of given field name. Throws FactoryException if field does not exist or parsing fails.
      Parameters:
      field - field name
      Returns:
      LineString if field value is not empty, empty Optional otherwise
    • getPoint

      public Optional<org.locationtech.jts.geom.Point> getPoint(String field)
      Parses and returns a geometrical Point from field value of given field name. Throws FactoryException if field does not exist or parsing fails.
      Parameters:
      field - field name
      Returns:
      Point if field value is not empty, empty Optional otherwise
    • getVoltageLvl

      public VoltageLevel getVoltageLvl(String voltLvlField, String ratedVoltField)
      Parses and returns a voltage level from field value of given field name. Throws FactoryException if field does not exist or parsing fails.
      Parameters:
      voltLvlField - name of the field containing the voltage level
      ratedVoltField - name of the field containing the rated voltage
      Returns:
      Voltage level
    • toString

      public String toString()
      Overrides:
      toString in class FactoryData