Class Property<T,​P>

  • Type Parameters:
    T - Object type.
    P - Property type.

    public class Property<T,​P>
    extends Object
    Defines a property of an object.
    Since:
    2022-05-16
    Author:
    miki
    • Constructor Detail

      • Property

        public Property​(Class<T> owner,
                        String name,
                        Class<P> type,
                        com.vaadin.flow.function.SerializableBiConsumer<T,​P> setter,
                        com.vaadin.flow.function.SerializableFunction<T,​P> getter,
                        PropertyMetadata... metadata)
        Constructs a Property of a given that belongs to the given owner, has a given value type, a corresponding setter and getter and optional PropertyMetadata.
        Parameters:
        owner - Object the property belongs to.
        name - Name of the property.
        type - Type of the property.
        setter - Setter. May be null.
        getter - Getter. May be null.
        metadata - Any PropertyMetadata this Property should have.
      • Property

        public Property​(Class<T> owner,
                        String name,
                        Class<P> type,
                        com.vaadin.flow.function.SerializableBiConsumer<T,​P> setter,
                        com.vaadin.flow.function.SerializableFunction<T,​P> getter,
                        Collection<PropertyMetadata> metadata)
        Constructs a Property of a given that belongs to the given owner, has a given value type, a corresponding setter and getter and optional PropertyMetadata.
        Parameters:
        owner - Object the property belongs to.
        name - Name of the property.
        type - Type of the property.
        setter - Setter. May be null.
        getter - Getter. May be null.
        metadata - Any PropertyMetadata this Property should have.
    • Method Detail

      • getName

        public String getName()
        Returns the name of this property.
        Returns:
        Name of the property.
      • getOwner

        public Class<T> getOwner()
        Returns the type the property belongs to.
        Returns:
        Type.
      • getSetter

        public Optional<com.vaadin.flow.function.SerializableBiConsumer<T,​P>> getSetter()
        Returns the setter for the property, if any.
        Returns:
        The setter, if any.
      • getGetter

        public Optional<com.vaadin.flow.function.SerializableFunction<T,​P>> getGetter()
        Returns the getter for the property, if any.
        Returns:
        The getter, if any.
      • getType

        public Class<P> getType()
        Returns the value type of the property.
        Returns:
        Value type.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object