Class GenericAttribute


  • public class GenericAttribute
    extends java.lang.Object
    Implements a generic attribute facade.
    • 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 name
        value - the attribute value
        dataType - the attribute value's data type
        unit - the attribute value's unit of measurement
        children - 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
      • 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:
        toString in class java.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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object