Class AbstractPropertyMap
java.lang.Object
com.vaadin.flow.internal.nodefeature.NodeFeature
com.vaadin.flow.internal.nodefeature.NodeMap
com.vaadin.flow.internal.nodefeature.AbstractPropertyMap
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ElementPropertyMap,ElementStylePropertyMap
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.booleanhasProperty(String name) Checks whether there is a property of the given name.static booleanisValidValueType(Serializable value) Checks if the given value is of a supported type.voidRemoves all properties.voidremoveProperty(String name) Removes the given property.voidsetProperty(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, updateFromClientMethods 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 ornullemitChange- 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 property- Returns:
trueif there is a property with the given name;falseif 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 property- Returns:
- the property value;
nullif 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 null- Returns:
trueif the type is supported,falseotherwise
-