source: josm/trunk/src/org/openstreetmap/josm/data/osm/Tagged.java@ 11680

Last change on this file since 11680 was 11608, checked in by Don-vip, 7 years ago

fix #14402 - add blacklist for leisure area values to avoid false positives - improve globally the detection of keys/tags

  • Property svn:eol-style set to native
File size: 2.0 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.osm;
3
4import java.util.Collection;
5import java.util.Map;
6
7/**
8 * Objects implement Tagged if they provide a map of key/value pairs.
9 *
10 * @since 2115
11 */
12// FIXME: better naming? setTags(), getTags(), getKeys() instead of keySet() ?
13//
14public interface Tagged {
15 /**
16 * Sets the map of key/value pairs
17 *
18 * @param keys the map of key value pairs. If null, reset to the empty map.
19 */
20 void setKeys(Map<String, String> keys);
21
22 /**
23 * Replies the map of key/value pairs. Never null, but may be the empty map.
24 *
25 * @return the map of key/value pairs
26 */
27 Map<String, String> getKeys();
28
29 /**
30 * Sets a key/value pairs
31 *
32 * @param key the key
33 * @param value the value. If null, removes the key/value pair.
34 */
35 void put(String key, String value);
36
37 /**
38 * Sets a key/value pairs
39 *
40 * @param tag The tag to set.
41 * @since 10736
42 */
43 default void put(Tag tag) {
44 put(tag.getKey(), tag.getValue());
45 }
46
47 /**
48 * Replies the value of the given key; null, if there is no value for this key
49 *
50 * @param key the key
51 * @return the value
52 */
53 String get(String key);
54
55 /**
56 * Removes a given key/value pair
57 *
58 * @param key the key
59 */
60 void remove(String key);
61
62 /**
63 * Replies true, if there is at least one key/value pair; false, otherwise
64 *
65 * @return true, if there is at least one key/value pair; false, otherwise
66 */
67 boolean hasKeys();
68
69 /**
70 * Replies true if there is a tag with key <code>key</code>.
71 *
72 * @param key the key
73 * @return true, if there is a tag with key <code>key</code>
74 * @since 11608
75 */
76 default boolean hasKey(String key) {
77 return get(key) != null;
78 }
79
80 /**
81 * Replies the set of keys
82 *
83 * @return the set of keys
84 */
85 Collection<String> keySet();
86
87 /**
88 * Removes all tags
89 */
90 void removeAll();
91}
Note: See TracBrowser for help on using the repository browser.