Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityEditor.EditorTask<T>
- Type Parameters:
T- the result type
- Enclosing interface:
EntityEditor<R extends EntityEditor<R>>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents a background enabled task for entities, used for inserting, updating, deleting, refreshing, setting or replacing, split up for use with a background thread.
A EntityEditor.EditorTask captures entity state and, where applicable, fires "before" events at creation time.
It should be executed promptly after creation, not cached for later use.
// Must be called on the UI thread, fires "before" events and captures entity state
EditorTask<Entity> task = editor.tasks().insert();
// Can safely be called in a background thread
EditorTask.Result<Entity> result = task.perform();
// Must be called on the UI thread, fires "after" events
Entity insertedEntity = result.handle();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe task result -
Method Summary
-
Method Details
-
perform
EntityEditor.EditorTask.Result<T> perform()Performs the task. May be called on a background thread.- Returns:
- the task result
-