Record Class NonCancellableTask<V>
java.lang.Object
java.lang.Record
dev.pfaff.altargui.async.NonCancellableTask<V>
- All Implemented Interfaces:
Task<V>
,AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionNonCancellableTask
(Task<V> task) Creates an instance of aNonCancellableTask
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
"Closes" the task.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
If this method returnstrue
, thenTask.join()
and friends are guaranteed not to block.join()
task()
Returns the value of thetask
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
NonCancellableTask
-
-
Method Details
-
join
- Specified by:
join
in interfaceTask<V>
- Throws:
TaskException
InterruptedException
-
joinUninterruptibly
- Specified by:
joinUninterruptibly
in interfaceTask<V>
- Throws:
TaskException
-
isCompleted
public boolean isCompleted()Description copied from interface:Task
If this method returnstrue
, thenTask.join()
and friends are guaranteed not to block.- Specified by:
isCompleted
in interfaceTask<V>
-
close
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
task
-