Class DefaultAttribute<T>

  • Type Parameters:
    T - the underlying type
    All Implemented Interfaces:
    java.io.Serializable, Attribute

    public class DefaultAttribute<T>
    extends java.lang.Object
    implements Attribute, java.io.Serializable
    Default implementation of an attribute.
    Author:
    Dimitrios Michail
    See Also:
    Serialized Form
    • Field Detail

      • NULL

        public static Attribute NULL
        The null attribute.
    • Constructor Detail

      • DefaultAttribute

        public DefaultAttribute​(T value,
                                AttributeType type)
        Create a new attribute
        Parameters:
        value - the value
        type - the type
    • Method Detail

      • getValue

        public java.lang.String getValue()
        Get the string value of the attribute
        Specified by:
        getValue in interface Attribute
        Returns:
        the string value of the attribute
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getType

        public AttributeType getType()
        Get the type of the attribute
        Specified by:
        getType in interface Attribute
        Returns:
        the type of the attribute
      • createAttribute

        public static Attribute createAttribute​(java.lang.Boolean value)
        Create a boolean attribute
        Parameters:
        value - the value
        Returns:
        the attribute
      • createAttribute

        public static Attribute createAttribute​(java.lang.Integer value)
        Create an integer attribute
        Parameters:
        value - the value
        Returns:
        the attribute
      • createAttribute

        public static Attribute createAttribute​(java.lang.Long value)
        Create a long attribute
        Parameters:
        value - the value
        Returns:
        the attribute
      • createAttribute

        public static Attribute createAttribute​(java.lang.Float value)
        Create a float attribute
        Parameters:
        value - the value
        Returns:
        the attribute
      • createAttribute

        public static Attribute createAttribute​(java.lang.Double value)
        Create a double attribute
        Parameters:
        value - the value
        Returns:
        the attribute
      • createAttribute

        public static Attribute createAttribute​(java.lang.String value)
        Create a string attribute
        Parameters:
        value - the value
        Returns:
        the attribute
      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object