Record Class SandboxedExecution.SandboxResult
java.lang.Object
java.lang.Record
com.tnsai.coordination.supervisor.SandboxedExecution.SandboxResult
- Record Components:
result- the agent's response, or null if execution failedcompleted- whether the execution completed within constraintsduration- how long the execution tookerror- error message if execution failed, or null if successful
- Enclosing class:
SandboxedExecution
public static record SandboxedExecution.SandboxResult(String result, boolean completed, Duration duration, String error)
extends Record
Result of a sandboxed execution.
-
Constructor Summary
ConstructorsConstructorDescriptionSandboxResult(String result, boolean completed, Duration duration, String error) Creates a SandboxResult with validation. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecompletedrecord component.duration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.Creates a failed result.final inthashCode()Returns a hash code value for this object.result()Returns the value of theresultrecord component.Creates a successful result.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SandboxResult
Creates a SandboxResult with validation.
-
-
Method Details
-
success
Creates a successful result.- Parameters:
result- the agent's responseduration- execution time- Returns:
- successful sandbox result
-
failure
Creates a failed result.- Parameters:
error- error descriptionduration- execution time before failure- Returns:
- failed sandbox result
-
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 '=='. -
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
completed
public boolean completed()Returns the value of thecompletedrecord component.- Returns:
- the value of the
completedrecord component
-
duration
Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-