public class UserCustomAttributesMap<T> extends AbstractMap<String,T>
MonitorUser
and UserConfig
.Modifier and Type | Class and Description |
---|---|
static interface |
UserCustomAttributesMap.EntityFactory<T>
The functional interface used to create user attribute entity to be persisted.
|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
UserCustomAttributesMap(Map<String,T> storage,
UserCustomAttributesMap.EntityFactory<T> attributeEntityFactory,
java.util.function.Function<T,String> attributeEntityReader,
Runnable modificationCallback)
Creates a new map that reflects view and changes on the given map transforming the values with the given
functions.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
Set<Map.Entry<String,T>> |
entrySet() |
T |
get(Object key) |
T |
put(String key,
T value) |
T |
remove(Object key) |
protected List<Object> |
storedToTransformed(String attributeId,
T attributeEntity)
Converts an attribute entity instance to the value according to its data type.
|
protected T |
transformedToStored(String attributeId,
List<Object> value)
Converts a data value to the attribute entity instance.
|
clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public UserCustomAttributesMap(Map<String,T> storage, UserCustomAttributesMap.EntityFactory<T> attributeEntityFactory, java.util.function.Function<T,String> attributeEntityReader, Runnable modificationCallback)
storage
- the underlying map.attributeEntityFactory
- function that returns a new attribute entity instance for a attribute identifier
and string value pair.attributeEntityReader
- function that returns the string value from a attribute entity instance.modificationCallback
- function called when this map is modified (element added, updated or removed).protected T transformedToStored(String attributeId, List<Object> value)
attributeId
- the attribute identifier.value
- the value with type according to the attribute data type.protected List<Object> storedToTransformed(String attributeId, T attributeEntity)
attributeId
- the attribute identifier.attributeEntity
- the attribute entity instance.public T put(String key, T value)
public T get(Object key)
public T remove(Object key)
public boolean containsKey(Object key)
containsKey
in interface Map<String,T>
containsKey
in class AbstractMap<String,T>
LumisXP 12.4.0.200625 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.