Package org.eclipse.jgit.attributes
Class Attribute
java.lang.Object
org.eclipse.jgit.attributes.Attribute
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe attribute value state see also https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates a new instance.Attribute(String key, Attribute.State state) Creates a new instanceprivateAttribute(String key, Attribute.State state, String value) -
Method Summary
-
Field Details
-
key
-
state
-
value
-
-
Constructor Details
-
Attribute
Creates a new instance- Parameters:
key- the attribute key. Should not benull.state- the attribute state. It should be eitherAttribute.State.SETorAttribute.State.UNSET. In order to create a custom value attribute prefer the use ofAttribute(String, String)constructor.
-
Attribute
-
Attribute
Creates a new instance.- Parameters:
key- the attribute key. Should not benull.value- the custom attribute value
-
-
Method Details
-
equals
-
getKey
Get key- Returns:
- the attribute key (never returns
null)
-
getState
Return the state.- Returns:
- the state (never returns
null)
-
getValue
Get value- Returns:
- the attribute value (may be
null)
-
hashCode
public int hashCode() -
toString
-