Record Class RPCInvocationResult.Failure
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.network.rpc.handler.RPCInvocationResult.Failure
- Record Components:
caughtException- the exception that was caught during the method invocation.invocationHandler- the handler that handled the invocation request.invokedMethod- the method that was invoked during handling of the RPC request.
- All Implemented Interfaces:
RPCInvocationResult
- Enclosing interface:
RPCInvocationResult
public static record RPCInvocationResult.Failure(@NonNull Throwable caughtException, @NonNull RPCHandler invocationHandler, @NonNull RPCMethodMetadata invokedMethod)
extends Record
implements RPCInvocationResult
Represents an invocation during which the target method threw an exception.
- 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 thecaughtExceptionrecord component.private final @NonNull RPCHandlerThe field for theinvocationHandlerrecord component.private final @NonNull RPCMethodMetadataThe field for theinvokedMethodrecord component.Fields inherited from interface RPCInvocationResult
STATUS_BAD_REQUEST, STATUS_ERROR, STATUS_OK, STATUS_SERVER_ERROR -
Constructor Summary
ConstructorsConstructorDescriptionFailure(@NonNull Throwable caughtException, @NonNull RPCHandler invocationHandler, @NonNull RPCMethodMetadata invokedMethod) Creates an instance of aFailurerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecaughtExceptionrecord 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.Returns the value of theinvokedMethodrecord component.final StringtoString()Returns a string representation of this record class.booleanGet if the method invocation was successful or not.
-
Field Details
-
caughtException
The field for thecaughtExceptionrecord component. -
invocationHandler
The field for theinvocationHandlerrecord component. -
invokedMethod
The field for theinvokedMethodrecord component.
-
-
Constructor Details
-
Failure
public Failure(@NonNull @NonNull Throwable caughtException, @NonNull @NonNull RPCHandler invocationHandler, @NonNull @NonNull RPCMethodMetadata invokedMethod) Creates an instance of aFailurerecord class.- Parameters:
caughtException- the value for thecaughtExceptionrecord componentinvocationHandler- the value for theinvocationHandlerrecord componentinvokedMethod- the value for theinvokedMethodrecord 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). -
caughtException
Returns the value of thecaughtExceptionrecord component.- Returns:
- the value of the
caughtExceptionrecord component
-
invocationHandler
Returns the value of theinvocationHandlerrecord component.- Specified by:
invocationHandlerin interfaceRPCInvocationResult- Returns:
- the value of the
invocationHandlerrecord component
-
invokedMethod
Returns the value of theinvokedMethodrecord component.- Returns:
- the value of the
invokedMethodrecord component
-