Class Attribute

java.lang.Object
org.eclipse.jgit.attributes.Attribute

public final class Attribute extends Object
Represents an attribute.

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

  • Set - represented by Attribute.State.SET
  • Unset - represented by Attribute.State.UNSET
  • Set to a value - represented by Attribute.State.CUSTOM
  • Unspecified - used to revert an attribute . This is crucial in order to mark an attribute as unspecified in the attributes map and thus preventing following (with lower priority) nodes from setting the attribute to a value at all
Since:
3.7
  • Field Details

  • Constructor Details

  • Method Details

    • equals

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

      public String getKey()
      Get key
      Returns:
      the attribute key (never returns null)
    • getState

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

      public String getValue()
      Get value
      Returns:
      the attribute value (may be null)
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object