public final class Attribute
extends java.lang.Object
According to the man page, an attribute can have the following states:
Attribute.State.SET
Attribute.State.UNSET
Attribute.State.CUSTOM
Modifier and Type | Class and Description |
---|---|
static class |
Attribute.State
The attribute value state
see also https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
key |
private Attribute.State |
state |
private java.lang.String |
value |
Modifier | Constructor and Description |
---|---|
|
Attribute(java.lang.String key,
Attribute.State state)
Creates a new instance
|
private |
Attribute(java.lang.String key,
Attribute.State state,
java.lang.String value) |
|
Attribute(java.lang.String key,
java.lang.String value)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getKey()
Get key
|
Attribute.State |
getState()
Return the state.
|
java.lang.String |
getValue()
Get value
|
int |
hashCode() |
java.lang.String |
toString() |
private final java.lang.String key
private final Attribute.State state
private final java.lang.String value
public Attribute(java.lang.String key, Attribute.State state)
key
- the attribute key. Should not be null
.state
- the attribute state. It should be either
Attribute.State.SET
or
Attribute.State.UNSET
. In
order to create a custom value attribute prefer the use of
Attribute(String, String)
constructor.private Attribute(java.lang.String key, Attribute.State state, java.lang.String value)
public Attribute(java.lang.String key, java.lang.String value)
key
- the attribute key. Should not be null
.value
- the custom attribute valuepublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String getKey()
null
)public Attribute.State getState()
null
)public java.lang.String getValue()
null
)public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object