public interface Tagged
Modifier and Type | Field and Description |
---|---|
static int |
MAX_TAG_LENGTH
The maximum tag length allowed by OSM API
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
get(java.lang.String key)
Replies the value of the given key; null, if there is no value for this key
|
java.util.Map<java.lang.String,java.lang.String> |
getKeys()
Replies the map of key/value pairs.
|
int |
getNumKeys()
Gets the number of keys
|
default boolean |
hasKey(java.lang.String key)
Replies true if there is a tag with key
key . |
boolean |
hasKeys()
Replies true, if there is at least one key/value pair; false, otherwise
|
default boolean |
hasTag(java.lang.String key)
Replies true if there is a non-empty tag with key
key . |
default boolean |
hasTag(java.lang.String key,
java.util.Collection<java.lang.String> values)
Tests whether this primitive contains a tag consisting of
key and any of values . |
default boolean |
hasTag(java.lang.String key,
java.lang.String... values)
Tests whether this primitive contains a tag consisting of
key and any of values . |
default boolean |
hasTag(java.lang.String key,
java.lang.String value)
Tests whether this primitive contains a tag consisting of
key and value . |
default boolean |
hasTagDifferent(java.lang.String key,
java.util.Collection<java.lang.String> values)
Tests whether this primitive contains a tag consisting of
key and none of values . |
default boolean |
hasTagDifferent(java.lang.String key,
java.lang.String... values)
Tests whether this primitive contains a tag consisting of
key and none of values . |
default boolean |
hasTagDifferent(java.lang.String key,
java.lang.String value)
Tests whether this primitive contains a tag consisting of
key and a value different from value . |
java.util.Collection<java.lang.String> |
keySet()
Replies the set of keys
|
void |
put(java.lang.String key,
java.lang.String value)
Sets a key/value pairs
|
default void |
put(Tag tag)
Sets a key/value pairs
|
void |
remove(java.lang.String key)
Removes a given key/value pair
|
void |
removeAll()
Removes all tags
|
void |
setKeys(java.util.Map<java.lang.String,java.lang.String> keys)
Sets the map of key/value pairs
|
default void |
visitKeys(KeyValueVisitor visitor)
Calls the visitor for every key/value pair.
|
static final int MAX_TAG_LENGTH
void setKeys(java.util.Map<java.lang.String,java.lang.String> keys)
keys
- the map of key value pairs. If null, reset to the empty map.java.util.Map<java.lang.String,java.lang.String> getKeys()
default void visitKeys(KeyValueVisitor visitor)
visitor
- The visitor to call.getKeys()
void put(java.lang.String key, java.lang.String value)
key
- the keyvalue
- the value. If null, removes the key/value pair.java.lang.String get(java.lang.String key)
key
- the keyvoid remove(java.lang.String key)
key
- the keyboolean hasKeys()
default boolean hasKey(java.lang.String key)
key
.
The value could however be empty. See hasTag(String)
to check for non-empty tags.key
- the keykey
hasTag(String)
default boolean hasTag(java.lang.String key)
key
.key
- the keykey
hasKey(String)
default boolean hasTag(java.lang.String key, java.lang.String value)
key
and value
.key
- the key forming the tag.value
- value forming the tag.key
and value
.default boolean hasTag(java.lang.String key, java.lang.String... values)
key
and any of values
.key
- the key forming the tag.values
- one or many values forming the tag.key
and any of values
.default boolean hasTag(java.lang.String key, java.util.Collection<java.lang.String> values)
key
and any of values
.key
- the key forming the tag.values
- one or many values forming the tag.key
and any of values
.default boolean hasTagDifferent(java.lang.String key, java.lang.String value)
key
and a value different from value
.key
- the key forming the tag.value
- value not forming the tag.key
and a value different from value
.default boolean hasTagDifferent(java.lang.String key, java.lang.String... values)
key
and none of values
.key
- the key forming the tag.values
- one or many values forming the tag.key
and none of values
.default boolean hasTagDifferent(java.lang.String key, java.util.Collection<java.lang.String> values)
key
and none of values
.key
- the key forming the tag.values
- one or many values forming the tag.key
and none of values
.java.util.Collection<java.lang.String> keySet()
int getNumKeys()
void removeAll()