com.vaadin.flow.component.
Class PropertyDescriptors
- java.lang.Object
-
- com.vaadin.flow.component.PropertyDescriptors
-
public final class PropertyDescriptors extends Object
Factory methods for creating
PropertyDescriptor
instances.Since:
1.0
Author:
Vaadin Ltd
-
-
Method Summary
All Methods Modifier and Type Method Description static PropertyDescriptor<String,String>
attributeWithDefault(String name, String defaultValue)
Creates a descriptor for an attribute of the component's root element with a non-null default value.
static PropertyDescriptor<String,String>
attributeWithDefault(String name, String defaultValue, boolean removeDefault)
Creates a descriptor for an attribute of the component's root element with a non-null default value.
static PropertyDescriptor<String,Optional<String>>
optionalAttributeWithDefault(String name, String defaultValue)
Creates a descriptor for an optional attribute of the component's root element with a non-null default value.
static PropertyDescriptor<String,Optional<String>>
optionalAttributeWithDefault(String name, String defaultValue, boolean removeDefault)
Creates a descriptor for an optional attribute of the component's root element with a non-null default value.
static PropertyDescriptor<Boolean,Boolean>
propertyWithDefault(String name, Boolean defaultValue)
Creates a descriptor for a property of the component's root element with a non-null default value.
static PropertyDescriptor<Double,Double>
propertyWithDefault(String name, Double defaultValue)
Creates a descriptor for a property of the component's root element with a non-null default value.
static PropertyDescriptor<Integer,Integer>
propertyWithDefault(String name, Integer defaultValue)
Creates a descriptor for a property of the component's root element with a non-null default value.
static PropertyDescriptor<String,String>
propertyWithDefault(String name, String defaultValue)
Creates a descriptor for a property of the component's root element with a non-null default value.
-
-
-
Method Detail
-
propertyWithDefault
public static PropertyDescriptor<String,String> propertyWithDefault(String name, String defaultValue)
Creates a descriptor for a property of the component's root element with a non-null default value.
Parameters:
name
- the name of the element property, notnull
defaultValue
- the default value of the property, notnull
Returns:
a property descriptor, not
null
-
propertyWithDefault
public static PropertyDescriptor<Integer,Integer> propertyWithDefault(String name, Integer defaultValue)
Creates a descriptor for a property of the component's root element with a non-null default value.
Parameters:
name
- the name of the element property, notnull
defaultValue
- the default value of the property, notnull
Returns:
a property descriptor, not
null
-
propertyWithDefault
public static PropertyDescriptor<Double,Double> propertyWithDefault(String name, Double defaultValue)
Creates a descriptor for a property of the component's root element with a non-null default value.
Parameters:
name
- the name of the element property, notnull
defaultValue
- the default value of the property, notnull
Returns:
a property descriptor, not
null
-
propertyWithDefault
public static PropertyDescriptor<Boolean,Boolean> propertyWithDefault(String name, Boolean defaultValue)
Creates a descriptor for a property of the component's root element with a non-null default value.
Parameters:
name
- the name of the element property, notnull
defaultValue
- the default value of the property, notnull
Returns:
a property descriptor, not
null
-
attributeWithDefault
public static PropertyDescriptor<String,String> attributeWithDefault(String name, String defaultValue)
Creates a descriptor for an attribute of the component's root element with a non-null default value.
Parameters:
name
- the name of the element attribute, notnull
defaultValue
- the default value of the property, notnull
Returns:
a property descriptor, not
null
-
attributeWithDefault
public static PropertyDescriptor<String,String> attributeWithDefault(String name, String defaultValue, boolean removeDefault)
Creates a descriptor for an attribute of the component's root element with a non-null default value.
Parameters:
name
- the name of the element attribute, notnull
defaultValue
- the default value of the property, notnull
removeDefault
- iftrue
then attribute with default value will be removed, otherwise attribute with the default value will be kept as isReturns:
a property descriptor, not
null
-
optionalAttributeWithDefault
public static PropertyDescriptor<String,Optional<String>> optionalAttributeWithDefault(String name, String defaultValue)
Creates a descriptor for an optional attribute of the component's root element with a non-null default value. The getter will return an empty optional if the element doesn't have the attribute, or if its value is the default value.
Parameters:
name
- the name of the element attribute, notnull
defaultValue
- the default value of the property, notnull
Returns:
a property descriptor, not
null
-
optionalAttributeWithDefault
public static PropertyDescriptor<String,Optional<String>> optionalAttributeWithDefault(String name, String defaultValue, boolean removeDefault)
Creates a descriptor for an optional attribute of the component's root element with a non-null default value. The getter will return an empty optional if the element doesn't have the attribute, or if its value is the default value.
Parameters:
name
- the name of the element attribute, notnull
defaultValue
- the default value of the property, notnull
removeDefault
- iftrue
then attribute with default value will be removed, otherwise attribute with the default value will be kept as isReturns:
a property descriptor, not
null
-
-