public class KeyMapper<V> extends Object implements DataKeyMapper<V>, Serializable
KeyMapper is the simple two-way map for generating textual keys
for objects and retrieving the objects later with the key.| Constructor and Description |
|---|
KeyMapper() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(String key)
Checks if the given key is mapped to an object.
|
V |
get(String key)
Retrieves object with the key.
|
String |
key(V o)
Gets key for an object.
|
void |
refresh(V dataObject,
ValueProvider<V,Object> identifierGetter)
Updates any existing mappings of given data object.
|
void |
remove(V removeobj)
Removes object from the mapper.
|
void |
removeAll()
Removes all objects from the mapper.
|
public String key(V o)
key in interface DataKeyMapper<V>o - the object.public V get(String key)
get in interface DataKeyMapper<V>key - the name with the desired value.public void remove(V removeobj)
remove in interface DataKeyMapper<V>removeobj - the object to be removed.public void removeAll()
removeAll in interface DataKeyMapper<V>public boolean containsKey(String key)
key - the key to checktrue if the key is currently mapped,
false otherwisepublic void refresh(V dataObject, ValueProvider<V,Object> identifierGetter)
DataKeyMapperrefresh in interface DataKeyMapper<V>dataObject - the data object to updateidentifierGetter - the function to get an identifier from a data objectCopyright © 2017 Vaadin Ltd. All rights reserved.