Record Class FailedHttpResponse<T>
java.lang.Object
java.lang.Record
meteordevelopment.meteorclient.utils.network.FailedHttpResponse<T>
- All Implemented Interfaces:
HttpResponse<T>
public record FailedHttpResponse<T>(HttpRequest request, Exception exception)
extends Record
implements HttpResponse<T>
Failed
HttpResponse object that is returned from Http sendRequest methods when
HttpClient.send(HttpRequest, BodyHandler) throws an exception instead of returning an error response, such
as when the connection is interrupted or an I/O error occurs. This object is used to prevent sendRequest
methods from returning null.-
Nested Class Summary
Nested classes/interfaces inherited from interface java.net.http.HttpResponse
HttpResponse.BodyHandler<T>, HttpResponse.BodyHandlers, HttpResponse.BodySubscriber<T>, HttpResponse.BodySubscribers, HttpResponse.PushPromiseHandler<T>, HttpResponse.ResponseInfo -
Constructor Summary
ConstructorsConstructorDescriptionFailedHttpResponse(HttpRequest request, Exception exception) Creates an instance of aFailedHttpResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionbody()final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexceptionrecord component.final inthashCode()Returns a hash code value for this object.headers()request()Returns the value of therequestrecord component.intfinal StringtoString()Returns a string representation of this record class.uri()version()
-
Constructor Details
-
FailedHttpResponse
Creates an instance of aFailedHttpResponserecord class.- Parameters:
request- the value for therequestrecord componentexception- the value for theexceptionrecord component
-
-
Method Details
-
statusCode
public int statusCode()- Specified by:
statusCodein interfaceHttpResponse<T>
-
previousResponse
- Specified by:
previousResponsein interfaceHttpResponse<T>
-
headers
- Specified by:
headersin interfaceHttpResponse<T>
-
body
- Specified by:
bodyin interfaceHttpResponse<T>
-
sslSession
- Specified by:
sslSessionin interfaceHttpResponse<T>
-
uri
- Specified by:
uriin interfaceHttpResponse<T>
-
version
- Specified by:
versionin interfaceHttpResponse<T>
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
request
Returns the value of therequestrecord component.- Specified by:
requestin interfaceHttpResponse<T>- Returns:
- the value of the
requestrecord component
-
exception
Returns the value of theexceptionrecord component.- Returns:
- the value of the
exceptionrecord component
-