Class PropertyData<P extends Serializable>
- java.lang.Object
-
- com.vaadin.flow.server.webcomponent.PropertyData<P>
-
- Type Parameters:
P
- type of the property's value
- All Implemented Interfaces:
Serializable
public final class PropertyData<P extends Serializable> extends Object implements Serializable
Value object containing information of a web component's property field.- Since:
- 2.0
- Author:
- Vaadin Ltd.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PropertyData(String name, Class<P> type, boolean readOnly, P defaultValue)
Constructs a newPropertyData
instance tied to the type of the property's value given bytype
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
P
getDefaultValue()
Getter for the initial value if given.String
getName()
Getter for the property name.Class<P>
getType()
Getter for the property value class type.int
hashCode()
boolean
isReadOnly()
Checks if the property is a read-only value.PropertyData<P>
updateReadOnly(boolean readOnly)
Creates a copy ofthis
with the newreadOnly
value.
-
-
-
Constructor Detail
-
PropertyData
public PropertyData(String name, Class<P> type, boolean readOnly, P defaultValue)
Constructs a newPropertyData
instance tied to the type of the property's value given bytype
.- Parameters:
name
- name of the propertytype
- type of the property valuereadOnly
- is the property read-only (on the client-side)defaultValue
- default value for the property
-
-
Method Detail
-
getName
public String getName()
Getter for the property name.- Returns:
- property name
-
getType
public Class<P> getType()
Getter for the property value class type.- Returns:
- value class type
-
getDefaultValue
public P getDefaultValue()
Getter for the initial value if given.- Returns:
- initial value or
null
if none given
-
isReadOnly
public boolean isReadOnly()
Checks if the property is a read-only value.- Returns:
- is read-only
-
updateReadOnly
public PropertyData<P> updateReadOnly(boolean readOnly)
Creates a copy ofthis
with the newreadOnly
value.- Parameters:
readOnly
- newreadOnly
value- Returns:
- copy of
this
-
-