Record Class RealmsError.CustomError
java.lang.Object
java.lang.Record
com.mojang.realmsclient.client.RealmsError.CustomError
- All Implemented Interfaces:
RealmsError
- Enclosing interface:
RealmsError
public static record RealmsError.CustomError(int httpCode, @Nullable Component payload)
extends Record
implements RealmsError
-
Nested Class Summary
Nested classes/interfaces inherited from interface RealmsError
RealmsError.AuthenticationError, RealmsError.CustomError, RealmsError.ErrorWithJsonPayload, RealmsError.ErrorWithRawPayload -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprivate final intThe field for thehttpCoderecord component.private final @Nullable ComponentThe field for thepayloadrecord component.static final Componentstatic final RealmsError.CustomErrorFields inherited from interface RealmsError
LOGGER, NO_MESSAGE -
Constructor Summary
ConstructorsConstructorDescriptionCustomError(int httpCode, @Nullable Component payload) Creates an instance of aCustomErrorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic RealmsError.CustomErrorstatic RealmsError.CustomErrorconnectivityError(RealmsHttpException exception) final booleanIndicates whether some other object is "equal to" this one.intfinal inthashCode()Returns a hash code value for this object.static RealmsError.CustomErrorhtmlPayload(int statusCode, String payload) inthttpCode()Returns the value of thehttpCoderecord component.static RealmsError.CustomErrornoPayload(int statusCode) @Nullable Componentpayload()Returns the value of thepayloadrecord component.static RealmsError.CustomErrorretry(int statusCode) final StringtoString()Returns a string representation of this record class.static RealmsError.CustomErrorunknownCompatibilityResponse(String response)
-
Field Details
-
httpCode
private final int httpCodeThe field for thehttpCoderecord component. -
payload
The field for thepayloadrecord component. -
SERVICE_BUSY
-
RETRY_MESSAGE
-
BODY_TAG
- See Also:
-
CLOSING_BODY_TAG
- See Also:
-
-
Constructor Details
-
CustomError
Creates an instance of aCustomErrorrecord class.- Parameters:
httpCode- the value for thehttpCoderecord componentpayload- the value for thepayloadrecord component
-
-
Method Details
-
unknownCompatibilityResponse
-
configurationError
-
connectivityError
-
retry
-
noPayload
-
htmlPayload
-
errorCode
public int errorCode()- Specified by:
errorCodein interfaceRealmsError
-
errorMessage
- Specified by:
errorMessagein interfaceRealmsError
-
logMessage
- Specified by:
logMessagein interfaceRealmsError
-
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. -
httpCode
public int httpCode()Returns the value of thehttpCoderecord component.- Returns:
- the value of the
httpCoderecord component
-
payload
Returns the value of thepayloadrecord component.- Returns:
- the value of the
payloadrecord component
-