Class Attribute


  • public final class Attribute
    extends java.lang.Object
    Represents an attribute.

    According to the man page, an attribute can have the following states:

    Since:
    3.7
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Attribute.State
      The attribute value state
    • Constructor Summary

      Constructors 
      Constructor Description
      Attribute​(java.lang.String key, java.lang.String value)
      Creates a new instance.
      Attribute​(java.lang.String key, Attribute.State state)
      Creates a new instance
    • Constructor Detail

      • Attribute

        public Attribute​(java.lang.String key,
                         java.lang.String value)
        Creates a new instance.
        Parameters:
        key - the attribute key. Should not be null.
        value - the custom attribute value
    • Method Detail

      • equals

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

        public java.lang.String getKey()
        Returns:
        the attribute key (never returns null)
      • getState

        public Attribute.State getState()
        Returns the state.
        Returns:
        the state (never returns null)
      • getValue

        public java.lang.String getValue()
        Returns:
        the attribute value (may be null)
      • hashCode

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

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