Package com.tnsai.output.validation
Record Class StructuredOutputExecutor.StructuredOutputResult<T>
java.lang.Object
java.lang.Record
com.tnsai.output.validation.StructuredOutputExecutor.StructuredOutputResult<T>
- Enclosing class:
StructuredOutputExecutor<T>
public static record StructuredOutputExecutor.StructuredOutputResult<T>(boolean success, T value, List<String> errors, int attempts)
extends Record
Result of a structured output generation attempt.
-
Constructor Summary
ConstructorsConstructorDescriptionStructuredOutputResult(boolean success, T value, List<String> errors, int attempts) Creates an instance of aStructuredOutputResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintattempts()Returns the value of theattemptsrecord component.final booleanIndicates whether some other object is "equal to" this one.errors()Returns the value of theerrorsrecord component.final inthashCode()Returns a hash code value for this object.booleansuccess()Returns the value of thesuccessrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
StructuredOutputResult
Creates an instance of aStructuredOutputResultrecord class.- Parameters:
success- the value for thesuccessrecord componentvalue- the value for thevaluerecord componenterrors- the value for theerrorsrecord componentattempts- the value for theattemptsrecord component
-
-
Method Details
-
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 '=='. -
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
errors
Returns the value of theerrorsrecord component.- Returns:
- the value of the
errorsrecord component
-
attempts
public int attempts()Returns the value of theattemptsrecord component.- Returns:
- the value of the
attemptsrecord component
-