Record Class AgentRecoveryManager.RecoveryResult
java.lang.Object
java.lang.Record
com.tnsai.coordination.supervisor.AgentRecoveryManager.RecoveryResult
- Enclosing class:
AgentRecoveryManager
public static record AgentRecoveryManager.RecoveryResult(String agentId, AgentRecoveryManager.RecoveryAction actionTaken, boolean success, String detail, Instant timestamp)
extends Record
Result of a recovery attempt.
-
Constructor Summary
ConstructorsConstructorDescriptionRecoveryResult(String agentId, AgentRecoveryManager.RecoveryAction actionTaken, boolean success, String detail, Instant timestamp) Creates an instance of aRecoveryResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theactionTakenrecord component.agentId()Returns the value of theagentIdrecord component.detail()Returns the value of thedetailrecord component.final booleanIndicates whether some other object is "equal to" this one.failure(String agentId, AgentRecoveryManager.RecoveryAction action, String detail) final inthashCode()Returns a hash code value for this object.booleansuccess()Returns the value of thesuccessrecord component.success(String agentId, AgentRecoveryManager.RecoveryAction action, String detail) Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RecoveryResult
public RecoveryResult(String agentId, AgentRecoveryManager.RecoveryAction actionTaken, boolean success, String detail, Instant timestamp) Creates an instance of aRecoveryResultrecord class.- Parameters:
agentId- the value for theagentIdrecord componentactionTaken- the value for theactionTakenrecord componentsuccess- the value for thesuccessrecord componentdetail- the value for thedetailrecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
success
public static AgentRecoveryManager.RecoveryResult success(String agentId, AgentRecoveryManager.RecoveryAction action, String detail) -
failure
public static AgentRecoveryManager.RecoveryResult failure(String agentId, AgentRecoveryManager.RecoveryAction action, String detail) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
agentId
Returns the value of theagentIdrecord component.- Returns:
- the value of the
agentIdrecord component
-
actionTaken
Returns the value of theactionTakenrecord component.- Returns:
- the value of the
actionTakenrecord component
-
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
detail
Returns the value of thedetailrecord component.- Returns:
- the value of the
detailrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-