Package org.eclipse.jgit.attributes
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 -
null
is used instead of an instance of this class
- Since:
- 3.7
- Set - represented by
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Attribute.State
The attribute value state
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getKey()
Attribute.State
getState()
Returns the state.String
getValue()
int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
Attribute
public Attribute(String key, Attribute.State state)
Creates a new instance- Parameters:
key
- the attribute key. Should not benull
.state
- the attribute state. It should be eitherAttribute.State.SET
orAttribute.State.UNSET
. In order to create a custom value attribute prefer the use ofAttribute(String, String)
constructor.
-
-
Method Detail
-
getKey
public 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 String getValue()
- Returns:
- the attribute value (may be
null
)
-
-