Interface EntityEditModel.ValueEditor<T>
- Type Parameters:
T
- the attribute value type
- All Superinterfaces:
Observable<T>
,Observer<T>
,Value<T>
- Enclosing interface:
- EntityEditModel
Attribute
value in the underlying entity being edited.-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.common.value.Value
Value.Builder<T,
B extends Value.Builder<T, B>>, Value.BuilderFactory, Value.Notify, Value.Validator<T> -
Method Summary
Modifier and TypeMethodDescriptionReturns theValue
instance controlling the default value supplier for the given attribute.edited()
Returns an observer notified each time this value is modified viaValue.set(Object)
.modified()
Returns anObservableState
instance indicating whether the value of the given attribute has been modified.persist()
Returns aState
controlling whether the last used value for this attribute should persist when defaults are set.void
revert()
Reverts to the original value if modifiedvalid()
Methods inherited from interface is.codion.common.observable.Observable
addConsumer, addListener, addWeakConsumer, addWeakListener, get, getOrThrow, getOrThrow, isEqualTo, isNotEqualTo, isNull, isNullable, observer, optional, removeConsumer, removeListener, removeWeakConsumer, removeWeakListener
Methods inherited from interface is.codion.common.value.Value
addValidator, clear, link, link, map, observable, removeValidator, set, unlink, unlink, validate
-
Method Details
-
revert
void revert()Reverts to the original value if modified -
persist
State persist()Returns a
State
controlling whether the last used value for this attribute should persist when defaults are set.- Returns:
- a
State
controlling whether the given attribute value should persist when defaults are set - See Also:
-
valid
ObservableState valid()- Returns:
- an
ObservableState
indicating the valid status of this attribute value.
-
modified
ObservableState modified()Returns an
ObservableState
instance indicating whether the value of the given attribute has been modified.Note that only attributes of existing entities are modified, attributes of new, or non-existing entities are never modified.
- Returns:
- an
ObservableState
indicating the modified state of the value of the given attribute - See Also:
-
edited
Returns an observer notified each time this value is modified via
Value.set(Object)
.This event is NOT triggered when the value changes due to the entity being set via
Value.set(Object)
orEntityEditModel.EntityEditor.defaults()
.Note that this event is only triggered if the value actually changes.
- Returns:
- an observer notified when the given attribute value is edited
-
defaultValue
Returns the
Value
instance controlling the default value supplier for the given attribute.Used when the underlying value is not persistent.
Use
EntityEditModel.EntityEditor.defaults()
to populate the model with the default values.
-