public class ObjectProperty<T> extends AbstractProperty<T>
Property
interface.AbstractProperty.ReadOnlyStatusChangeEvent
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer
Constructor and Description |
---|
ObjectProperty(T value)
Creates a new instance of ObjectProperty with the given value.
|
ObjectProperty(T value,
Class<T> type)
Creates a new instance of ObjectProperty with the given value and type.
|
ObjectProperty(T value,
Class<T> type,
boolean readOnly)
Creates a new instance of ObjectProperty with the given value, type and
read-only mode status.
|
Modifier and Type | Method and Description |
---|---|
Class<T> |
getType()
Returns the type of the ObjectProperty.
|
T |
getValue()
Gets the value stored in the Property.
|
void |
setValue(T newValue)
Sets the value of the property.
|
addListener, addListener, addReadOnlyStatusChangeListener, addValueChangeListener, fireReadOnlyStatusChange, fireValueChange, getListeners, isReadOnly, removeListener, removeListener, removeReadOnlyStatusChangeListener, removeValueChangeListener, setReadOnly, toString
public ObjectProperty(T value)
value
- the Initial value of the Property.public ObjectProperty(T value, Class<T> type)
value
- the Initial value of the Property.type
- the type of the value. The value must be assignable to given
type.public ObjectProperty(T value, Class<T> type, boolean readOnly)
ObjectProperty(Object, Class)
.value
- the Initial value of the property.type
- the type of the value. value
must be assignable
to this type.readOnly
- Sets the read-only mode.public final Class<T> getType()
getValue
and setValue
must be compatible with this type: one must be
able to safely cast the value returned from getValue
to the
given type and pass any variable assignable to this type as an argument
to setValue
.public T getValue()
public void setValue(T newValue) throws Property.ReadOnlyException
newValue
- the New value of the property.Property.ReadOnlyException
- if the object is in read-only modeProperty.ReadOnlyException
- if the object is in read-only modeCopyright © 2021 Vaadin Ltd. All rights reserved.