Record Class GuardrailResult
java.lang.Object
java.lang.Record
com.tnsai.quality.tracing.guardrail.GuardrailResult
- Record Components:
passed- whether the content passed the guardrail checkscore- confidence score (0.0 to 1.0)reason- human-readable explanation of the result
Result of a guardrail evaluation.
-
Constructor Summary
ConstructorsConstructorDescriptionGuardrailResult(boolean passed, double score, String reason) Creates an instance of aGuardrailResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static GuardrailResultCreates a failing result with a reason and confidence score.static GuardrailResultCreates a failing result with a reason and full confidence.final inthashCode()Returns a hash code value for this object.static GuardrailResultpass()Creates a passing result with full confidence.static GuardrailResultCreates a passing result with a reason.booleanpassed()Returns the value of thepassedrecord component.reason()Returns the value of thereasonrecord component.doublescore()Returns the value of thescorerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
pass
Creates a passing result with full confidence. -
pass
Creates a passing result with a reason. -
fail
Creates a failing result with a reason and confidence score. -
fail
Creates a failing result with a reason and full confidence. -
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 '=='. -
passed
public boolean passed()Returns the value of thepassedrecord component.- Returns:
- the value of the
passedrecord component
-
score
public double score()Returns the value of thescorerecord component.- Returns:
- the value of the
scorerecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-