Modifier and Type | Field and Description |
---|---|
private String |
key |
private String |
value |
Constructor and Description |
---|
Tag()
Create an empty tag whose key and value are empty.
|
Tag(String key)
Create a tag whose key is
key and whose value is
empty. |
Tag(String key,
String value)
Creates a tag for a key and a value.
|
Tag(Tag tag)
Creates clone of the tag
tag . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getKey()
Replies the key of the tag.
|
String |
getValue()
Replies the value of the tag.
|
int |
hashCode() |
boolean |
matchesKey(String key)
Replies true if the key of this tag is equal to
key . |
String |
toString() |
public Tag()
public Tag(String key)
key
and whose value is
empty.key
- the key. If null, it is set to the empty key.public Tag(String key, String value)
key
- the keyvalue
- the valuepublic String getKey()
public String getValue()
public boolean matchesKey(String key)
key
.
If key
is null, assumes the empty key.key
- the keykey