py4j.reflection

## Class MethodInvoker

- java.lang.Object
- - py4j.reflection.MethodInvoker

-     public class MethodInvoker
      extends Object

  A MethodInvoker translates a call made in a Python Program into a call to a Java method.

  A MethodInvoker is tailored to a particular set of actual parameters and indicates how far the calling context is from the method signature.

  For example, a call to method1(String) from Python can be translated to a call to method1(char) in Java, with a cost of 1.

  Author:
    Barthelemy Dagenais

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static MethodInvoker` | `INVALID_INVOKER`
    `static int` | `INVALID_INVOKER_COST`
    `static int` | `MAX_DISTANCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MethodInvoker(Constructor<?> constructor, TypeConverter[] converters, int cost)`
    `MethodInvoker(Method method, TypeConverter[] converters, int cost)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static MethodInvoker` | `buildInvoker(Constructor<?> constructor, Class<?>[] arguments)`
    `static MethodInvoker` | `buildInvoker(Method method, Class<?>[] arguments)`
    `Constructor<?>` | `getConstructor()`
    `TypeConverter[]` | `getConverters()`
    `int` | `getCost()`
    `Method` | `getMethod()`
    `Object` | `invoke(Object obj, Object[] arguments)`
    `boolean` | `isVoid()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INVALID_INVOKER_COST

          public static final int INVALID_INVOKER_COST

      See Also:
        Constant Field Values

    - #### MAX_DISTANCE

          public static final int MAX_DISTANCE

      See Also:
        Constant Field Values

    - #### INVALID_INVOKER

          public static final MethodInvoker INVALID_INVOKER

  - ### Constructor Detail

    - #### MethodInvoker

          public MethodInvoker(Constructor<?> constructor,
                               TypeConverter[] converters,
                               int cost)

    - #### MethodInvoker

          public MethodInvoker(Method method,
                               TypeConverter[] converters,
                               int cost)

  - ### Method Detail

    - #### buildInvoker

          public static MethodInvoker buildInvoker(Constructor<?> constructor,
                                                   Class<?>[] arguments)

    - #### buildInvoker

          public static MethodInvoker buildInvoker(Method method,
                                                   Class<?>[] arguments)

    - #### getConstructor

          public Constructor<?> getConstructor()

    - #### getConverters

          public TypeConverter[] getConverters()

    - #### getCost

          public int getCost()

    - #### getMethod

          public Method getMethod()

    - #### invoke

          public Object invoke(Object obj,
                               Object[] arguments)

    - #### isVoid

          public boolean isVoid()