Package org.dellroad.stuff.vaadin8
Class SimplePropertySet<T>
- java.lang.Object
-
- org.dellroad.stuff.vaadin8.SimplePropertySet<T>
-
- All Implemented Interfaces:
PropertySet<T>,Serializable
public class SimplePropertySet<T> extends Object implements PropertySet<T>
StraightforwardPropertySetimplementation usingSimplePropertyDefinitions.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimplePropertySet(Class<T> type)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> SimplePropertyDefinition<T,V>add(Class<V> type, String name, String caption, Method getter, Method setter)Add a new property.booleanequals(Object obj)Stream<PropertyDefinition<T,?>>getProperties()Optional<PropertyDefinition<T,?>>getProperty(String name)Set<String>getPropertyNames()Get all property names.Class<T>getType()Get the associated type.inthashCode()StringtoString()
-
-
-
Method Detail
-
add
public <V> SimplePropertyDefinition<T,V> add(Class<V> type, String name, String caption, Method getter, Method setter)
Add a new property.- Type Parameters:
V- property type- Parameters:
type- type of propertyname- name of propertycaption- property captiongetter- property gettersetter- property setter, or null for none- Returns:
- newly created property definition
- Throws:
IllegalArgumentException- if any parameter other thansetteris nullIllegalArgumentException- if a property namednamealready exists
-
getPropertyNames
public Set<String> getPropertyNames()
Get all property names.- Returns:
- all property names
-
getProperties
public Stream<PropertyDefinition<T,?>> getProperties()
- Specified by:
getPropertiesin interfacePropertySet<T>
-
getProperty
public Optional<PropertyDefinition<T,?>> getProperty(String name)
- Specified by:
getPropertyin interfacePropertySet<T>
-
-