com.vaadin.flow.internal.nodefeature.
Class AbstractPropertyMap
All Implemented Interfaces:
Direct Known Subclasses:
Abstract class to be used as a parent for node maps which supports setting properties in a map.
For internal use only. May be renamed or removed in a future release.
Since:
1.0
Author:
Vaadin Ltd
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractPropertyMap
(StateNode node) Creates a new element property map for the given node.
-
Method Summary
Modifier and TypeMethodDescriptiongetProperty
(String name) Gets the value of the given property.
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
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.
Methods inherited from class com.vaadin.flow.internal.nodefeature.NodeMap
clear, collectChanges, contains, forEachChild, generateChangesFromEmpty, get, getOrDefault, getOrDefault, getOrDefault, keySet, mayUpdateFromClient, producePutChange, put, put, remove, updateFromClient
Methods inherited from class com.vaadin.flow.internal.nodefeature.NodeFeature
allowsChanges, attachPotentialChild, detatchPotentialChild, getNode, onAttach, onDetach
-
Constructor Details
-
AbstractPropertyMap
Creates a new element property map for the given node.
Parameters:
node
- the node that the map belongs to
-
-
Method Details
-
setProperty
Sets a property to the given value.
Parameters:
name
- the property namevalue
- the value, must be a string, a boolean, a double ornull
emitChange
- true to create a change event for the client side -
hasProperty
Checks whether there is a property of the given name.
Parameters:
name
- the name of the propertyReturns:
true
if there is a property with the given name;false
if there is no property -
removeProperty
Removes the given property.
Parameters:
name
- the name of the property to remove -
removeAllProperties
public void removeAllProperties()Removes all properties.
-
getProperty
Gets the value of the given property.
Parameters:
name
- the name of the propertyReturns:
the property value;
null
if there is no property or if the value is explicitly set to null -
getPropertyNames
Gets the property names.
Returns:
a stream containing all the property names that have been set
-
isValidValueType
Checks if the given value is of a supported type.
Parameters:
value
- the value to check, may be nullReturns:
true
if the type is supported,false
otherwise
-