Class GenericAttribute
- java.lang.Object
-
- com.smartgridready.communicator.common.api.dto.GenericAttribute
-
public class GenericAttribute extends java.lang.ObjectImplements a generic attribute facade.
-
-
Constructor Summary
Constructors Constructor Description GenericAttribute(java.lang.String name, Value value, DataTypeInfo dataType, com.smartgridready.ns.v0.Units unit, java.util.List<GenericAttribute> children)Construct a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.util.List<GenericAttribute>getChildren()Gets the attribute's sub-attributes.DataTypeInfogetDataType()Gets the value's data type.java.lang.StringgetName()Gets the attribute name.com.smartgridready.ns.v0.UnitsgetUnit()Gets the value's unit of measurement.ValuegetValue()Gets the attribute value.inthashCode()static java.util.List<GenericAttribute>mapGenericAttributes(java.util.List<com.smartgridready.ns.v0.GenericAttributeProductEnd> genericAttributeProducts)Maps a list of generic attributes.static GenericAttributeof(com.smartgridready.ns.v0.GenericAttributeProduct genAttribute)Creates a new instance.static GenericAttributeof(com.smartgridready.ns.v0.GenericAttributeProductEnd genAttributeChild)Creates a new instance.java.lang.StringtoString()
-
-
-
Constructor Detail
-
GenericAttribute
public GenericAttribute(java.lang.String name, Value value, DataTypeInfo dataType, com.smartgridready.ns.v0.Units unit, java.util.List<GenericAttribute> children)Construct a new instance.- Parameters:
name- the attribute namevalue- the attribute valuedataType- the attribute value's data typeunit- the attribute value's unit of measurementchildren- a list of child attributes
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the attribute name.- Returns:
- a string
-
getValue
public Value getValue()
Gets the attribute value.- Returns:
- a value
-
getDataType
public DataTypeInfo getDataType()
Gets the value's data type.- Returns:
- a data type info
-
getUnit
public com.smartgridready.ns.v0.Units getUnit()
Gets the value's unit of measurement.- Returns:
- an instance of
Units
-
getChildren
public java.util.List<GenericAttribute> getChildren()
Gets the attribute's sub-attributes.- Returns:
- a list of
GenericAttribute
-
of
public static GenericAttribute of(com.smartgridready.ns.v0.GenericAttributeProduct genAttribute)
Creates a new instance.- Parameters:
genAttribute- the attribute specification- Returns:
- a new instance of
GenericAttribute
-
of
public static GenericAttribute of(com.smartgridready.ns.v0.GenericAttributeProductEnd genAttributeChild)
Creates a new instance.- Parameters:
genAttributeChild- the attribute specification- Returns:
- a new instance of
GenericAttribute
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
mapGenericAttributes
public static java.util.List<GenericAttribute> mapGenericAttributes(java.util.List<com.smartgridready.ns.v0.GenericAttributeProductEnd> genericAttributeProducts)
Maps a list of generic attributes.- Parameters:
genericAttributeProducts- the attribute specifications- Returns:
- a list of
GenericAttribute
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-