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.

@FunctionalInterface public static interface EntityEditor.EditorTask<T>

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: