Record Class HttpError.ClientError
java.lang.Object
java.lang.Record
dmx.fun.http.HttpError.ClientError
- Record Components:
statusCode- the HTTP status code (400–499)response- the full HTTP response
- All Implemented Interfaces:
HttpError
- Enclosing interface:
HttpError
public static record HttpError.ClientError(int statusCode, HttpResponse<?> response)
extends Record
implements HttpError
4xx — bad request, unauthorized, not found, etc.
-
Nested Class Summary
Nested classes/interfaces inherited from interface HttpError
HttpError.ClientError, HttpError.NetworkFailure, HttpError.ServerError, HttpError.Timeout -
Constructor Summary
ConstructorsConstructorDescriptionClientError(int statusCode, HttpResponse<?> response) Creates an instance of aClientErrorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.HttpResponse<?> response()Returns the value of theresponserecord component.intReturns the value of thestatusCoderecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ClientError
Creates an instance of aClientErrorrecord class.- Parameters:
statusCode- the value for thestatusCoderecord componentresponse- the value for theresponserecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
statusCode
public int statusCode()Returns the value of thestatusCoderecord component.- Returns:
- the value of the
statusCoderecord component
-
response
-