Record Class RPCInvocationResult.Success
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.network.rpc.handler.RPCInvocationResult.Success
- Record Components:
invocationResult- the value returned from 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.Success(@Nullable Object invocationResult, @NonNull RPCHandler invocationHandler, @NonNull RPCMethodMetadata invokedMethod)
extends Record
implements RPCInvocationResult
Represents a successful method invocation via RPC. This wraps the value returned by the called method.
- 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 TypeFieldDescriptionprivate final @NonNull RPCHandlerThe field for theinvocationHandlerrecord component.The field for theinvocationResultrecord 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
ConstructorsConstructorDescriptionSuccess(@Nullable Object invocationResult, @NonNull RPCHandler invocationHandler, @NonNull RPCMethodMetadata invokedMethod) Creates an instance of aSuccessrecord 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.Returns the value of theinvocationHandlerrecord component.Returns the value of theinvocationResultrecord 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
-
invocationResult
The field for theinvocationResultrecord component. -
invocationHandler
The field for theinvocationHandlerrecord component. -
invokedMethod
The field for theinvokedMethodrecord component.
-
-
Constructor Details
-
Success
public Success(@Nullable @Nullable Object invocationResult, @NonNull @NonNull RPCHandler invocationHandler, @NonNull @NonNull RPCMethodMetadata invokedMethod) Creates an instance of aSuccessrecord class.- Parameters:
invocationResult- the value for theinvocationResultrecord 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). -
invocationResult
Returns the value of theinvocationResultrecord component.- Returns:
- the value of the
invocationResultrecord 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
-