This interface provides access to a task result that was associated with it during construction time. The interface
optionally supports modifying the applied dependency to the associated task. Specifying the dependency via
setTaskOutputChangeDetector(
The interface doesn't define the manner of how the task result is retrieved, and it is implementation dependent based on the context.
This interface mainly exists to make fine graining dependency application possible using TaskResultResolver
and when working with structured task results.
Working with objects that have their values backed by task results may occur when the build task executions are
already finished. In these cases, a TaskResultResolver instance can be used to retrieve task results for
given task identifiers. However, when working with the same data during task execution, the task dependencies may
need to be refined for proper incremental implementation. As the objects have a TaskResultResolver reference
instead of TaskContext, without the use of this interface the dependency reification would not be possible,
although it is necessary by the consumers.
By using this interface, the task result consumers can have a common interface to work with task results that support dependency reification and with those that don't. If the TaskOutputChangeDetector cannot be set, the implementations will silently ignore.
This interface may be implemented by clients.
public TaskResultDependencyHandle | clone() Clones the dependency handle, returning a clean one. |
public static TaskResultDependencyHandle | Creates a simple TaskResultDependencyHandle that returns the argument object. |
public Object | get() Gets the task result for the associated task. |
public default void | setTaskOutputChangeDetector( Sets the output change detector for the associated task dependency. |
The returned dependency handle is semantically the same as if it was newly retrieved from the same method as
this
handle.
The returned dependency handle has no dependency support, only a simple wrapper for the specified object.
The behaviour of this method is implementation dependent, it may wait for the associated task to finish.
If setTaskOutputChangeDetector(
The result of this call may or may not be an instance of StructuredTaskResult based on the associated context the TaskResultDependencyHandle was retrieved from.
Works the same way as TaskDependencyFuture.setTaskOutputChangeDetector(
Implementations that don't support this method must silently ignore it. If they don't support it, and task dependencies make sense in the associated context, then a dependency equivalent to CommonTaskOutputChangeDetector.ALWAYS must be installed.
Implementations may require that get() is called before setting the task output change detector and may throw IllegalStateException in case this requirement is violated.
null
.