Class Property<T,P>
java.lang.Object
org.vaadin.miki.superfields.object.Property<T,P>
- Type Parameters:
T- Object type.P- Property type.
Defines a property of an object.
- Since:
- 2022-05-16
- Author:
- miki
-
Constructor Summary
ConstructorsConstructorDescriptionProperty(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 aPropertyof a given that belongs to the given owner, has a given value type, a corresponding setter and getter and optionalPropertyMetadata.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 aPropertyof a given that belongs to the given owner, has a given value type, a corresponding setter and getter and optionalPropertyMetadata. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the getter for the property, if any.Returns the map ofPropertyMetadata, organised by metadata name for easier use.getName()Returns the name of this property.getOwner()Returns the type the property belongs to.Returns the setter for the property, if any.getType()Returns the value type of the property.inthashCode()toString()
-
Constructor Details
-
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 aPropertyof a given that belongs to the given owner, has a given value type, a corresponding setter and getter and optionalPropertyMetadata.- Parameters:
owner- Object the property belongs to.name- Name of the property.type- Type of the property.setter- Setter. May benull.getter- Getter. May benull.metadata- AnyPropertyMetadatathisPropertyshould 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 aPropertyof a given that belongs to the given owner, has a given value type, a corresponding setter and getter and optionalPropertyMetadata.- Parameters:
owner- Object the property belongs to.name- Name of the property.type- Type of the property.setter- Setter. May benull.getter- Getter. May benull.metadata- AnyPropertyMetadatathisPropertyshould have.
-
-
Method Details
-
getName
Returns the name of this property.- Returns:
- Name of the property.
-
getOwner
Returns the type the property belongs to.- Returns:
- Type.
-
getSetter
Returns the setter for the property, if any.- Returns:
- The setter, if any.
-
getGetter
Returns the getter for the property, if any.- Returns:
- The getter, if any.
-
getType
Returns the value type of the property.- Returns:
- Value type.
-
getMetadata
Returns the map ofPropertyMetadata, organised by metadata name for easier use.- Returns:
- A non-
null, but possibly empty, map ofPropertyMetadataby name. Any changes to the returned map will affect this object.
-
equals
-
hashCode
public int hashCode() -
toString
-