Package com.tnsai.agents.interrupt
Record Class InterruptEvent.ErrorInterrupt
java.lang.Object
java.lang.Record
com.tnsai.agents.interrupt.InterruptEvent.ErrorInterrupt
- All Implemented Interfaces:
InterruptEvent
- Enclosing interface:
InterruptEvent
public static record InterruptEvent.ErrorInterrupt(String reason, Instant timestamp, Throwable cause, boolean recoverable)
extends Record
implements InterruptEvent
Error interrupt for recoverable errors.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tnsai.agents.interrupt.InterruptEvent
InterruptEvent.BudgetInterrupt, InterruptEvent.ErrorInterrupt, InterruptEvent.ExternalInterrupt, InterruptEvent.TimeoutInterrupt, InterruptEvent.UserInterrupt -
Constructor Summary
ConstructorsConstructorDescriptionErrorInterrupt(String reason, Instant timestamp, Throwable cause, boolean recoverable) Creates an instance of aErrorInterruptrecord class.ErrorInterrupt(Throwable cause, boolean recoverable) -
Method Summary
Modifier and TypeMethodDescriptioncause()Returns the value of thecauserecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns true if the agent can be resumed after this interrupt.reason()Returns the value of thereasonrecord component.booleanReturns the value of therecoverablerecord component.booleanReturns true if the agent should checkpoint its state.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ErrorInterrupt
-
ErrorInterrupt
Creates an instance of aErrorInterruptrecord class.- Parameters:
reason- the value for thereasonrecord componenttimestamp- the value for thetimestamprecord componentcause- the value for thecauserecord componentrecoverable- the value for therecoverablerecord component
-
-
Method Details
-
shouldCheckpoint
public boolean shouldCheckpoint()Description copied from interface:InterruptEventReturns true if the agent should checkpoint its state.- Specified by:
shouldCheckpointin interfaceInterruptEvent
-
isResumable
public boolean isResumable()Description copied from interface:InterruptEventReturns true if the agent can be resumed after this interrupt.- Specified by:
isResumablein interfaceInterruptEvent
-
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 '=='. -
reason
Returns the value of thereasonrecord component.- Specified by:
reasonin interfaceInterruptEvent- Returns:
- the value of the
reasonrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Specified by:
timestampin interfaceInterruptEvent- Returns:
- the value of the
timestamprecord component
-
cause
Returns the value of thecauserecord component.- Returns:
- the value of the
causerecord component
-
recoverable
public boolean recoverable()Returns the value of therecoverablerecord component.- Returns:
- the value of the
recoverablerecord component
-