public abstract class AbstractPropertyMap extends NodeMap
Constructor and Description |
---|
AbstractPropertyMap(StateNode node)
Creates a new element property map for the given node.
|
Modifier and Type | Method and Description |
---|---|
Serializable |
getProperty(String name)
Gets the value of the given property.
|
Stream<String> |
getPropertyNames()
Gets the property names.
|
boolean |
hasProperty(String name)
Checks whether there is a property of the given name.
|
static boolean |
isValidValueType(Serializable value)
Checks if the given value is of a supported type.
|
void |
removeAllProperties()
Removes all properties.
|
void |
removeProperty(String name)
Removes the given property.
|
void |
setProperty(String name,
Serializable value,
boolean emitChange)
Sets a property to the given value.
|
clear, collectChanges, contains, forEachChild, generateChangesFromEmpty, get, getOrDefault, getOrDefault, getOrDefault, keySet, mayUpdateFromClient, put, put, remove, updateFromClient
allowsChanges, attachPotentialChild, detatchPotentialChild, getNode, onAttach, onDetach
public AbstractPropertyMap(StateNode node)
node
- the node that the map belongs topublic void setProperty(String name, Serializable value, boolean emitChange)
name
- the property namevalue
- the value, must be a string, a boolean, a double or
null
emitChange
- true to create a change event for the client sidepublic boolean hasProperty(String name)
name
- the name of the propertytrue
if there is a property with the given name;
false
if there is no propertypublic void removeProperty(String name)
name
- the name of the property to removepublic void removeAllProperties()
public Serializable getProperty(String name)
name
- the name of the propertynull
if there is no property or
if the value is explicitly set to nullpublic Stream<String> getPropertyNames()
public static boolean isValidValueType(Serializable value)
value
- the value to check, may be nulltrue
if the type is supported, false
otherwiseCopyright © 2019. All rights reserved.