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:
  • Constructor Details

    • 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 by type.
      Parameters:
      name - name of the property
      type - type of the property value
      readOnly - is the property read-only (on the client-side)
      defaultValue - default value for the property
  • Method Details

    • 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 new readOnly value.
      Parameters:
      readOnly - new readOnly value
      Returns:
      copy of this
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object