Package edu.ie3.datamodel.io.factory
Class FactoryData
java.lang.Object
edu.ie3.datamodel.io.factory.FactoryData
- Direct Known Subclasses:
EntityData
,SimpleFactoryData
,TimeBasedValueData
-
Constructor Summary
ModifierConstructorDescriptionprotected
FactoryData
(Map<String, String> fieldsToAttributes, Class<?> targetClass) -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(String key) Checks whether attribute map contains a value for given keyboolean
double
Returns double value for given field name.Returns field value for given field name.getFieldOptional
(String field) Returns field value for given field name, or empty Optional if field does not exist.int
Returns int value for given field name.<Q extends javax.measure.Quantity<Q>>
tech.units.indriya.ComparableQuantity<Q>getQuantity
(String field, javax.measure.Unit<Q> unit) Parses and returns a Quantity from field value of given field name.Class<?>
Parses and returns a UUID from field value of given field name.UUID[]
Parses and returns an array of UUIDs from field value of given field name.int
hashCode()
toString()
-
Constructor Details
-
FactoryData
-
-
Method Details
-
getFieldsToValues
-
getTargetClass
-
containsKey
Checks whether attribute map contains a value for given key- Parameters:
key
- key to check for- Returns:
- whether attribute map contains given field or not
-
getField
Returns field value for given field name. ThrowsFactoryException
if field does not exist.- Parameters:
field
- field name- Returns:
- field value
-
getFieldOptional
Returns field value for given field name, or empty Optional if field does not exist.- Parameters:
field
- field name- Returns:
- field value
-
getQuantity
public <Q extends javax.measure.Quantity<Q>> tech.units.indriya.ComparableQuantity<Q> getQuantity(String field, javax.measure.Unit<Q> unit) Parses and returns a Quantity from field value of given field name. ThrowsFactoryException
if field does not exist or parsing fails.- Type Parameters:
Q
- unit type parameter- Parameters:
field
- field nameunit
- unit of Quantity- Returns:
- Quantity of given field with given unit
-
getInt
Returns int value for given field name. ThrowsFactoryException
if field does not exist or parsing fails.- Parameters:
field
- field name- Returns:
- int value
-
getDouble
Returns double value for given field name. ThrowsFactoryException
if field does not exist or parsing fails.- Parameters:
field
- field name- Returns:
- double value
-
getUUID
Parses and returns a UUID from field value of given field name. ThrowsFactoryException
if field does not exist or parsing fails.- Parameters:
field
- field name- Returns:
- UUID
-
getUUIDs
Parses and returns an array of UUIDs from field value of given field name. ThrowsFactoryException
if field does not exist or parsing fails.- Parameters:
field
- field name- Returns:
- UUID
-
equals
-
hashCode
public int hashCode() -
toString
-