Class DefaultRPCInvocationContext.Builder
java.lang.Object
eu.cloudnetservice.driver.network.rpc.defaults.handler.DefaultRPCInvocationContext.Builder
- All Implemented Interfaces:
RPCInvocationContext.Builder
- Enclosing class:
DefaultRPCInvocationContext
public static final class DefaultRPCInvocationContext.Builder
extends Object
implements RPCInvocationContext.Builder
The default builder implementation for an RPC invocation context.
- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionargumentInformation(@NonNull DataBuf information) Sets the buffer containing the argument information for the method invocation.build()Builds a new invocation context based on the arguments supplied to this builder.methodDescriptor(@NonNull String methodDescriptor) Sets the method descriptor of the method that should be called.methodName(@NonNull String methodName) Sets the name of the method that should be called.workingInstance(@Nullable Object instance) Sets the instance which should get used for method invocation, might be null if no specific instance should be used.
-
Field Details
-
methodName
-
methodDescriptor
-
argumentInformation
-
workingInstance
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
methodName
Sets the name of the method that should be called.- Specified by:
methodNamein interfaceRPCInvocationContext.Builder- Parameters:
methodName- the name of the method to call.- Returns:
- this builder, for chaining.
-
methodDescriptor
@NonNull public RPCInvocationContext.Builder methodDescriptor(@NonNull @NonNull String methodDescriptor) Sets the method descriptor of the method that should be called.- Specified by:
methodDescriptorin interfaceRPCInvocationContext.Builder- Parameters:
methodDescriptor- the descriptor of the method to call.- Returns:
- this builder, for chaining.
-
argumentInformation
@NonNull public RPCInvocationContext.Builder argumentInformation(@NonNull @NonNull DataBuf information) Sets the buffer containing the argument information for the method invocation. The buffer can be suffixed with more information that the arguments.- Specified by:
argumentInformationin interfaceRPCInvocationContext.Builder- Parameters:
information- the buffer holding the arguments for the method call.- Returns:
- this builder, for chaining.
-
workingInstance
Sets the instance which should get used for method invocation, might be null if no specific instance should be used. If given, the handler will consider this instance first and fall back to the bound instance if not given.- Specified by:
workingInstancein interfaceRPCInvocationContext.Builder- Parameters:
instance- the instance to use for method calls.- Returns:
- this builder, for chaining.
-
build
Builds a new invocation context based on the arguments supplied to this builder.- Specified by:
buildin interfaceRPCInvocationContext.Builder- Returns:
- a new invocation context from this builder.
-