Package bridge

Class Invocation.Executor

java.lang.Object
bridge.Invocation.Executor
Enclosing class:
Invocation

public final class Invocation.Executor extends Object
A class that is used to build method invocations
Notes:
Invocations must be constructed and completed in a single statement. Partial invocations may not be stored.
  • Method Details

    • with

      public Invocation.Executor with(@Polymorphic Object argument)
      Adds an argument to the stack
      Parameters:
      argument - Argument value
      Returns:
      An imaginary reference for you to continue executing your request with.
      Notes:
      Calling this overload will cause the parameter type to be determined automatically.
    • with

      public Invocation.Executor with(Class<?> parameter, Object argument)
      Adds an argument to the stack
      Parameters:
      parameter - Parameter type constant – no dynamic values are permitted here.
      argument - Argument value
      Returns:
      An imaginary reference for you to continue executing your request with.
      Throws:
      ClassCastException - When the argument is not convertible to the provided parameter type.
    • with

      public Invocation.Executor with(String parameter, Object argument)
      Adds an argument to the stack
      Parameters:
      parameter - Parameter type name constant – no dynamic values or string manipulation is permitted here.
      argument - Argument value
      Returns:
      An imaginary reference for you to continue executing your request with.
      Throws:
      NoClassDefFoundError - When no type with the provided name can be resolved.
      ClassCastException - When the argument is not convertible to the provided parameter type.
    • check

      public <X extends Throwable> Invocation.Executor check() throws X
      Brings an exception into scope
      Type Parameters:
      X - Exception type
      Returns:
      An imaginary reference for you to continue executing your request with.
      Throws:
      X - When the invoked method throws X.
    • check

      public <X extends Throwable> Invocation.Executor check(Class<X> exception) throws X
      Brings an exception into scope
      Type Parameters:
      X - Exception type
      Parameters:
      exception - Exception type constant – no dynamic values are permitted here.
      Returns:
      An imaginary reference for you to continue executing your request with.
      Throws:
      X - When the invoked method throws X.
    • invoke

      public <@Polymorphic T> T invoke()
      Executes the method
      Type Parameters:
      T - Requested type
      Returns:
      The real return value of the method.
      Throws:
      NoSuchMethodError - When no method with the provided description can be resolved.
      IllegalAccessError - When the resolved method's access modifiers prevent it from being invoked.
      IncompatibleClassChangeError - When the resolved method is accessed from the wrong context.
      AbstractMethodError - When the resolved method is abstract and no implementation exists.
      UnsatisfiedLinkError - When the resolved method is native and no implementation exists.
      NullPointerException - When the resolved method is an instance method and the instance is null.
      ClassCastException - When the returned value is not convertible to the requested type.