Interface EntityEditor.EditorValue<T>

Type Parameters:
T - the attribute value type
All Superinterfaces:
Observable<T>, Observer<T>, Value<T>
Enclosing interface:
EntityEditor

public static interface EntityEditor.EditorValue<T> extends Value<T>
Provides edit access to an Attribute value in the underlying entity being edited.
  • Method Details

    • attribute

      Attribute<T> attribute()
      Returns:
      the attribute
    • original

      @Nullable T original()
      Returns:
      the original value, or the current one if not modified
      See Also:
    • 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 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

      Returns:
      an ObservableState indicating the valid status of this attribute value.
    • present

      ObservableState present()
      Returns:
      an ObservableState indicating 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 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

      Observer<T> 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 EntityEditor.set(Entity), EntityEditor.defaults() or 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

      Value<Supplier<T>> defaultValue()

      Returns the Value instance controlling the default value supplier for the given attribute.

      Used when the underlying value is not persistent.

      Use EntityEditor.defaults() to populate the editor with default values.

      Returns:
      the Value instance controlling the default value supplier
      See Also: