Interface EntityEditModel.EditorValue<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 theValueinstance controlling the default value supplier for the given attribute.edited()Returns an observer notified each time this value is modified viaValue.set(Object).message()modified()Returns anObservableStateinstance indicating whether the value of the given attribute has been modified.persist()Returns aStatecontrolling whether the last used value for this attribute should persist when defaults are set.present()voidrevert()Reverts to the original value if modifiedvalid()voidvalidate()Updates the valid state of this value according to the underlying validatorMethods inherited from interface is.codion.common.observer.Observable
addConsumer, addListener, addWeakConsumer, addWeakListener, get, getOrThrow, getOrThrow, is, isNot, isNull, isNullable, observer, optional, removeConsumer, removeListener, removeWeakConsumer, removeWeakListenerMethods 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 -
validate
void validate()Updates the valid state of this value according to the underlying validator- See Also:
-
persist
State persist()Returns a
Statecontrolling whether the last used value for this attribute should persist when defaults are set.- Returns:
- a
Statecontrolling whether the given attribute value should persist when defaults are set - See Also:
-
valid
ObservableState valid()- Returns:
- an
ObservableStateindicating the valid status of this attribute value.
-
present
ObservableState present()- Returns:
- an
ObservableStateindicating whether the value of this attribute is non-null
-
message
Observable<String> message()- Returns:
- the validation message in case the value is invalid, otherwise the attribute description
-
modified
ObservableState modified()Returns an
ObservableStateinstance 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
ObservableStateindicating 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
EntityEditModel.EntityEditor.set(Entity),EntityEditModel.EntityEditor.defaults()orEntityEditModel.EntityEditor.clear().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
Valueinstance controlling the default value supplier for the given attribute.Used when the underlying value is not persistent.
Use
EntityEditModel.EntityEditor.defaults()to populate the editor with default values.- Returns:
- the
Valueinstance controlling the default value supplier - See Also:
-