Package org.eclipse.jgit.attributes
Class Attributes
java.lang.Object
org.eclipse.jgit.attributes.Attributes
Represents a set of attributes for a path
- Since:
- 4.2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest if the given attributes implies to handle the related entry as a binary file (i.e.booleancontainsKey(String key) Whether there is an attribute with this keybooleanGet the attribute with the given keygetAll()Get all attributesReturn the state.Get attribute valueinthashCode()booleanIs this a custom attributebooleanisEmpty()Whether the set of attributes is emptybooleanWhether the attribute is setbooleanWhether the attribute is unsetbooleanisUnspecified(String key) Whether the attribute with the given key is unspecifiedvoidPut an attributevoidRemove attribute with given keytoString()
-
Field Details
-
map
-
-
Constructor Details
-
Attributes
Creates a new instance- Parameters:
attributes- aAttribute
-
-
Method Details
-
isEmpty
public boolean isEmpty()Whether the set of attributes is empty- Returns:
- true if the set does not contain any attributes
-
get
Get the attribute with the given key- Parameters:
key- aStringobject.- Returns:
- the attribute or null
-
getAll
Get all attributes- Returns:
- all attributes
-
put
Put an attribute- Parameters:
a- anAttribute
-
remove
Remove attribute with given key- Parameters:
key- an attribute name
-
containsKey
Whether there is an attribute with this key- Parameters:
key- key of an attribute- Returns:
- true if the
Attributescontains this key
-
getState
Return the state.- Parameters:
key- key of an attribute- Returns:
- the state (never returns
null)
-
isSet
Whether the attribute is set- Parameters:
key- aStringobject.- Returns:
- true if the key is
Attribute.State.SET, false in all other cases
-
isUnset
Whether the attribute is unset- Parameters:
key- aStringobject.- Returns:
- true if the key is
Attribute.State.UNSET, false in all other cases
-
isUnspecified
Whether the attribute with the given key is unspecified- Parameters:
key- aStringobject.- Returns:
- true if the key is
Attribute.State.UNSPECIFIED, false in all other cases
-
isCustom
Is this a custom attribute- Parameters:
key- aStringobject.- Returns:
- true if the key is
Attribute.State.CUSTOM, false in all other cases seegetValue(String)for the value of the key
-
getValue
Get attribute value- Parameters:
key- an attribute key- Returns:
- the attribute value (may be
null)
-
canBeContentMerged
public boolean canBeContentMerged()Test if the given attributes implies to handle the related entry as a binary file (i.e. if the entry has an -merge or a merge=binary attribute) or if it can be content merged.- Returns:
trueif the entry can be content merged,falseotherwise- Since:
- 4.9
-
toString
-
hashCode
public int hashCode() -
equals
-