Record Class InputGuardrailResult

java.lang.Object
java.lang.Record
io.quarkiverse.langchain4j.guardrails.InputGuardrailResult
Record Components:
result - The result of the input guardrail validation.
failures - The list of failures, empty if the validation succeeded.
All Implemented Interfaces:
GuardrailResult<InputGuardrailResult>

@Deprecated(forRemoval=true) public record InputGuardrailResult(GuardrailResult.Result result, String successfulText, List<InputGuardrailResult.Failure> failures) extends Record implements GuardrailResult<InputGuardrailResult>
Deprecated, for removal: This API element is subject to removal in a future version.
Use InputGuardrailResult instead
The result of the validation of an InputGuardrail
  • Constructor Details

    • InputGuardrailResult

      public InputGuardrailResult(GuardrailResult.Result result, String successfulText, List<InputGuardrailResult.Failure> failures)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an instance of a InputGuardrailResult record class.
      Parameters:
      result - the value for the result record component
      successfulText - the value for the successfulText record component
      failures - the value for the failures record component
  • Method Details

    • success

      public static InputGuardrailResult success()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • successWith

      public static InputGuardrailResult successWith(String successfulText)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • failure

      public static InputGuardrailResult failure(List<? extends GuardrailResult.Failure> failures)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getResult

      public GuardrailResult.Result getResult()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getResult in interface GuardrailResult<InputGuardrailResult>
    • isFatal

      public boolean isFatal()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      isFatal in interface GuardrailResult<InputGuardrailResult>
    • validatedBy

      public InputGuardrailResult validatedBy(Class<? extends Guardrail> guardrailClass)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      validatedBy in interface GuardrailResult<InputGuardrailResult>
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.
    • result

      public GuardrailResult.Result result()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the result record component.
      Returns:
      the value of the result record component
    • successfulText

      public String successfulText()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the successfulText record component.
      Specified by:
      successfulText in interface GuardrailResult<InputGuardrailResult>
      Returns:
      the value of the successfulText record component
    • failures

      public List<InputGuardrailResult.Failure> failures()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the failures record component.
      Specified by:
      failures in interface GuardrailResult<InputGuardrailResult>
      Returns:
      the value of the failures record component