Class DefaultAttribute<T>

java.lang.Object
org.jgrapht.nio.DefaultAttribute<T>
Type Parameters:
T - the underlying type
All Implemented Interfaces:
Serializable, Attribute

public class DefaultAttribute<T> extends Object implements Attribute, Serializable
Default implementation of an attribute.
Author:
Dimitrios Michail
See Also:
  • Field Details

    • NULL

      public static final Attribute NULL
      The null attribute.
  • Constructor Details

    • DefaultAttribute

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

    • getValue

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

      public String toString()
      Overrides:
      toString in class 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(Boolean value)
      Create a boolean attribute
      Parameters:
      value - the value
      Returns:
      the attribute
    • createAttribute

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

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

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

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

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

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object