public final class Attributes
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,Attribute> |
map |
Constructor and Description |
---|
Attributes(Attribute... attributes)
Creates a new instance
|
Modifier and Type | Method and Description |
---|---|
boolean |
canBeContentMerged()
Test if the given attributes implies to handle the related entry as a
binary file (i.e.
|
boolean |
containsKey(java.lang.String key)
Whether there is an attribute with this key
|
boolean |
equals(java.lang.Object obj) |
Attribute |
get(java.lang.String key)
Get the attribute with the given key
|
java.util.Collection<Attribute> |
getAll()
Get all attributes
|
Attribute.State |
getState(java.lang.String key)
Return the state.
|
java.lang.String |
getValue(java.lang.String key)
Get attribute value
|
int |
hashCode() |
boolean |
isCustom(java.lang.String key)
Is this a custom attribute
|
boolean |
isEmpty()
Whether the set of attributes is empty
|
boolean |
isSet(java.lang.String key)
Whether the attribute is set
|
boolean |
isUnset(java.lang.String key)
Whether the attribute is unset
|
boolean |
isUnspecified(java.lang.String key)
Whether the attribute with the given key is unspecified
|
void |
put(Attribute a)
Put an attribute
|
void |
remove(java.lang.String key)
Remove attribute with given key
|
java.lang.String |
toString() |
private final java.util.Map<java.lang.String,Attribute> map
public boolean isEmpty()
public Attribute get(java.lang.String key)
key
- a String
object.public java.util.Collection<Attribute> getAll()
public void remove(java.lang.String key)
key
- an attribute namepublic boolean containsKey(java.lang.String key)
key
- key of an attributeAttributes
contains this keypublic Attribute.State getState(java.lang.String key)
key
- key of an attributenull
)public boolean isSet(java.lang.String key)
key
- a String
object.Attribute.State.SET
, false in
all other casespublic boolean isUnset(java.lang.String key)
key
- a String
object.Attribute.State.UNSET
, false
in all other casespublic boolean isUnspecified(java.lang.String key)
key
- a String
object.Attribute.State.UNSPECIFIED
,
false in all other casespublic boolean isCustom(java.lang.String key)
key
- a String
object.Attribute.State.CUSTOM
, false
in all other cases see getValue(String)
for the value of
the keypublic java.lang.String getValue(java.lang.String key)
key
- an attribute keynull
)public boolean canBeContentMerged()
true
if the entry can be content merged,
false
otherwisepublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object