Record Class InputGuardrailResult.Failure

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

public static record InputGuardrailResult.Failure(String message, Throwable cause, Class<? extends Guardrail> guardrailClass) 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, Class<? extends Guardrail> guardrailClass)
      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
  • Method Details

    • withGuardrailClass

      public InputGuardrailResult.Failure withGuardrailClass(Class<? extends Guardrail> guardrailClass)
      Specified by:
      withGuardrailClass in interface GuardrailResult.Failure
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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