Interface RPCInvocationContext.Builder
- Enclosing interface:
RPCInvocationContext
public static interface RPCInvocationContext.Builder
Represents the builder for a rpc invocation context.
- Since:
- 4.0
-
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.
-
Method Details
-
methodName
@NonNull @Contract("_ -> this") @NonNull RPCInvocationContext.Builder methodName(@NonNull @NonNull String methodName) Sets the name of the method that should be called.- Parameters:
methodName- the name of the method to call.- Returns:
- this builder, for chaining.
- Throws:
NullPointerException- if the given method name is null.
-
methodDescriptor
@NonNull @Contract("_ -> this") @NonNull RPCInvocationContext.Builder methodDescriptor(@NonNull @NonNull String methodDescriptor) Sets the method descriptor of the method that should be called.- Parameters:
methodDescriptor- the descriptor of the method to call.- Returns:
- this builder, for chaining.
- Throws:
NullPointerException- if the given method descriptor is null.
-
argumentInformation
@NonNull @Contract("_ -> this") @NonNull 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.- Parameters:
information- the buffer holding the arguments for the method call.- Returns:
- this builder, for chaining.
- Throws:
NullPointerException- if the given buffer is null.
-
workingInstance
@NonNull @Contract("_ -> this") @NonNull RPCInvocationContext.Builder workingInstance(@Nullable @Nullable Object instance) 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.- 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.- Returns:
- a new invocation context from this builder.
- Throws:
NullPointerException- if either the channel, method name or argument buffer was not supplied.
-