Record Class BatchItemResult.Failure<T>
java.lang.Object
java.lang.Record
dev.langchain4j.model.batch.BatchItemResult.Failure<T>
- Type Parameters:
T- the type of the response payload that would have been produced on success- Record Components:
error- the error describing the failure, nevernull
- All Implemented Interfaces:
BatchItemResult<T>
- Enclosing interface:
BatchItemResult<T>
public static record BatchItemResult.Failure<T>(BatchError error)
extends Record
implements BatchItemResult<T>
The failed outcome of a single batch request.
-
Nested Class Summary
Nested classes/interfaces inherited from interface BatchItemResult
BatchItemResult.Failure<T>, BatchItemResult.Success<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.final inthashCode()Returns a hash code value for this object.booleanReturnstrueif this request succeeded.@Nullable Tresponse()Returns the successful response, ornullif this request failed.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Failure
Creates an instance of aFailurerecord class.- Parameters:
error- the value for theerrorrecord component
-
-
Method Details
-
isSuccess
public boolean isSuccess()Description copied from interface:BatchItemResultReturnstrueif this request succeeded.- Specified by:
isSuccessin interfaceBatchItemResult<T>
-
response
Description copied from interface:BatchItemResultReturns the successful response, ornullif this request failed.- Specified by:
responsein interfaceBatchItemResult<T>
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
error
Returns the value of theerrorrecord component.- Specified by:
errorin interfaceBatchItemResult<T>- Returns:
- the value of the
errorrecord component
-