Class BeanPropertySet<T>

  • Type Parameters:
    T - the type of the bean
    All Implemented Interfaces:
    PropertySet<T>, java.io.Serializable

    public class BeanPropertySet<T>
    extends java.lang.Object
    implements PropertySet<T>
    A PropertySet that uses reflection to find bean properties.
    Since:
    8.0
    Author:
    Vaadin Ltd
    See Also:
    Serialized Form
    • Method Detail

      • get

        public static <T> PropertySet<T> get​(java.lang.Class<? extends T> beanType)
        Gets a BeanPropertySet for the given bean type.
        Type Parameters:
        T - bean type
        Parameters:
        beanType - the bean type to get a property set for, not null
        Returns:
        the bean property set, not null
      • get

        public static <T> PropertySet<T> get​(java.lang.Class<? extends T> beanType,
                                             boolean checkNestedDefinitions,
                                             PropertyFilterDefinition filterDefinition)
        Gets a BeanPropertySet for the given bean type.
        Type Parameters:
        T - bean type
        Parameters:
        beanType - the bean type to get a property set for, not null
        checkNestedDefinitions - whether to scan for nested definitions in beanType
        filterDefinition - filtering conditions for nested properties
        Returns:
        the bean property set, not null
        Since:
        8.2
      • getProperties

        public java.util.stream.Stream<PropertyDefinition<T,​?>> getProperties()
        Description copied from interface: PropertySet
        Gets all known properties as a stream.
        Specified by:
        getProperties in interface PropertySet<T>
        Returns:
        a stream of property names, not null
      • getProperty

        public java.util.Optional<PropertyDefinition<T,​?>> getProperty​(java.lang.String name)
                                                                      throws java.lang.IllegalArgumentException
        Description copied from interface: PropertySet
        Gets the definition for the named property, or an empty optional if there is no property with the given name.
        Specified by:
        getProperty in interface PropertySet<T>
        Parameters:
        name - the property name to look for, not null
        Returns:
        the property definition, or empty optional if property doesn't exist
        Throws:
        java.lang.IllegalArgumentException
      • getBeanType

        public java.lang.Class<T> getBeanType()
        Gets the bean type of this bean property set.
        Returns:
        the bean type of this bean property set
        Since:
        8.2
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object