Interface ChainInstanceFactory<T>

Type Parameters:
T - the type of the generated class.
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ChainInstanceFactory<T>
Represents the factory which can be used to obtain new instances of generated chained rpc classes.
Since:
4.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    Constructs a new instance of the underlying class, using the given arguments both for the base rpc creation and the constructor invocation of the class.
    newInstance(@Nullable Object[] constructorArgs, @NonNull Object[] rpcArgs)
    Constructs a new instance of the underlying class.
    default T
    Constructs a new instance of the underlying class, using the given arguments only to create the base rpc for the class and supplying no parameters to the constructor.
  • Method Details

    • newInstance

      @NonNull default T newInstance(@NonNull @NonNull Object... args)
      Constructs a new instance of the underlying class, using the given arguments both for the base rpc creation and the constructor invocation of the class.
      Parameters:
      args - the arguments for the base rpc and constructor.
      Returns:
      a new instance of the underlying class.
      Throws:
      NullPointerException - if the given arguments are null.
    • newRPCOnlyInstance

      @NonNull default T newRPCOnlyInstance(@NonNull @NonNull Object... rpcArgs)
      Constructs a new instance of the underlying class, using the given arguments only to create the base rpc for the class and supplying no parameters to the constructor.
      Parameters:
      rpcArgs - the arguments for the rpc creation.
      Returns:
      a new instance of the underlying class.
      Throws:
      NullPointerException - if the given rpc args are null.
    • newInstance

      @NonNull T newInstance(@Nullable @Nullable Object[] constructorArgs, @NonNull @NonNull Object[] rpcArgs)
      Constructs a new instance of the underlying class.
      Parameters:
      constructorArgs - the arguments to supply to the constructor, null for no arguments.
      rpcArgs - the arguments to use for the base rpc creation.
      Returns:
      a new instance of the underlying class.
      Throws:
      NullPointerException - if the given rpc args are null.