Record Class WorkloadTaskStatus
java.lang.Object
java.lang.Record
org.j7m.middleware.examples.workload.WorkloadTaskStatus
- Record Components:
handle- task handlestate- lifecycle state such asSUBMITTED,RUNNING, orCANCELLEDownerId- current lease owner, or an empty string when not leasedfencingToken- current fencing tokenupdatedAt- last update timestamp
public record WorkloadTaskStatus(TaskHandle handle, String state, String ownerId, long fencingToken, Instant updatedAt)
extends Record
Immutable status snapshot for a workload-processing example task.
-
Constructor Summary
ConstructorsConstructorDescriptionWorkloadTaskStatus(TaskHandle handle, String state, String ownerId, long fencingToken, Instant updatedAt) Creates a task status snapshot. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the value of thefencingTokenrecord component.handle()Returns the value of thehandlerecord component.final inthashCode()Returns a hash code value for this object.ownerId()Returns the value of theownerIdrecord component.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theupdatedAtrecord component.
-
Constructor Details
-
WorkloadTaskStatus
public WorkloadTaskStatus(TaskHandle handle, String state, String ownerId, long fencingToken, Instant updatedAt) Creates a task status snapshot.- Parameters:
handle- task handlestate- lifecycle stateownerId- current ownerfencingToken- current fencing tokenupdatedAt- update timestamp
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
handle
-
state
-
ownerId
-
fencingToken
public long fencingToken()Returns the value of thefencingTokenrecord component.- Returns:
- the value of the
fencingTokenrecord component
-
updatedAt
-