Record Class OutputGuardrailResult.Failure

java.lang.Object
java.lang.Record
io.quarkiverse.langchain4j.guardrails.OutputGuardrailResult.Failure
All Implemented Interfaces:
GuardrailResult.Failure
Enclosing class:
OutputGuardrailResult

public static record OutputGuardrailResult.Failure(String message, Throwable cause, Class<? extends Guardrail> guardrailClass, boolean retry, String reprompt) extends Record implements GuardrailResult.Failure
  • Constructor Details

    • Failure

      public Failure(String message)
    • Failure

      public Failure(String message, Throwable cause)
    • Failure

      public Failure(String message, Throwable cause, boolean retry)
    • Failure

      public Failure(String message, Throwable cause, boolean retry, String reprompt)
    • Failure

      public Failure(String message, Throwable cause, Class<? extends Guardrail> guardrailClass, boolean retry, String reprompt)
      Creates an instance of a Failure record class.
      Parameters:
      message - the value for the message record component
      cause - the value for the cause record component
      guardrailClass - the value for the guardrailClass record component
      retry - the value for the retry record component
      reprompt - the value for the reprompt record component
  • Method Details

    • withGuardrailClass

      public OutputGuardrailResult.Failure withGuardrailClass(Class<? extends Guardrail> guardrailClass)
      Specified by:
      withGuardrailClass in interface GuardrailResult.Failure
    • blockRetry

      public OutputGuardrailResult.Failure blockRetry()
    • toString

      public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • message

      public String message()
      Returns the value of the message record component.
      Specified by:
      message in interface GuardrailResult.Failure
      Returns:
      the value of the message record component
    • cause

      public Throwable cause()
      Returns the value of the cause record component.
      Specified by:
      cause in interface GuardrailResult.Failure
      Returns:
      the value of the cause record component
    • guardrailClass

      public Class<? extends Guardrail> guardrailClass()
      Returns the value of the guardrailClass record component.
      Specified by:
      guardrailClass in interface GuardrailResult.Failure
      Returns:
      the value of the guardrailClass record component
    • retry

      public boolean retry()
      Returns the value of the retry record component.
      Returns:
      the value of the retry record component
    • reprompt

      public String reprompt()
      Returns the value of the reprompt record component.
      Returns:
      the value of the reprompt record component