com.vaadin.flow.server.webcomponent.
Class PropertyData<P extends Serializable>
- java.lang.Object
-
- com.vaadin.flow.server.webcomponent.PropertyData<P>
-
Type Parameters:
P
- type of the property's valueAll Implemented Interfaces:
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:
-
-
Constructor Summary
Constructors Constructor and Description PropertyData(String name, Class<P> type, boolean readOnly, P defaultValue)
Constructs a new
PropertyData
instance tied to the type of the property's value given bytype
.
-
Method Summary
All Methods Modifier and Type Method and 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 of
this
with the newreadOnly
value.
-
-
-
Constructor Detail
-
PropertyData
public PropertyData(String name, Class<P> type, boolean readOnly, P defaultValue)
Constructs a new
PropertyData
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 of
this
with the newreadOnly
value.Parameters:
readOnly
- newreadOnly
valueReturns:
copy of
this
-
-