Record Class RPCInvocationResult.ServerError
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.network.rpc.handler.RPCInvocationResult.ServerError
- Record Components:
detailMessage- a short detail description why the invocation wasn't possible.invocationHandler- the handler that handled the invocation request.
- All Implemented Interfaces:
RPCInvocationResult
- Enclosing interface:
RPCInvocationResult
public static record RPCInvocationResult.ServerError(@NonNull String detailMessage, @NonNull RPCHandler invocationHandler)
extends Record
implements RPCInvocationResult
Represents an invocation result for an invocation that failed because there was some mismatch on the server side
that caused the request to be unprocessable.
- Since:
- 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface RPCInvocationResult
RPCInvocationResult.BadRequest, RPCInvocationResult.Failure, RPCInvocationResult.ServerError, RPCInvocationResult.Success -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thedetailMessagerecord component.private final @NonNull RPCHandlerThe field for theinvocationHandlerrecord component.Fields inherited from interface RPCInvocationResult
STATUS_BAD_REQUEST, STATUS_ERROR, STATUS_OK, STATUS_SERVER_ERROR -
Constructor Summary
ConstructorsConstructorDescriptionServerError(@NonNull String detailMessage, @NonNull RPCHandler invocationHandler) Creates an instance of aServerErrorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedetailMessagerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinvocationHandlerrecord component.final StringtoString()Returns a string representation of this record class.booleanGet if the method invocation was successful or not.
-
Field Details
-
detailMessage
The field for thedetailMessagerecord component. -
invocationHandler
The field for theinvocationHandlerrecord component.
-
-
Constructor Details
-
ServerError
public ServerError(@NonNull @NonNull String detailMessage, @NonNull @NonNull RPCHandler invocationHandler) Creates an instance of aServerErrorrecord class.- Parameters:
detailMessage- the value for thedetailMessagerecord componentinvocationHandler- the value for theinvocationHandlerrecord component
-
-
Method Details
-
wasSuccessful
public boolean wasSuccessful()Get if the method invocation was successful or not.- Specified by:
wasSuccessfulin interfaceRPCInvocationResult- Returns:
- true if the method invocation was successful, false otherwise.
-
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). -
detailMessage
Returns the value of thedetailMessagerecord component.- Returns:
- the value of the
detailMessagerecord component
-
invocationHandler
Returns the value of theinvocationHandlerrecord component.- Specified by:
invocationHandlerin interfaceRPCInvocationResult- Returns:
- the value of the
invocationHandlerrecord component
-