org.springframework.shell.core

## Class MethodTarget

- java.lang.Object
- - org.springframework.shell.core.MethodTarget

-     public class MethodTarget
      extends Object

  A method that can be executed via a shell command.

  Immutable since 1.2.0.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MethodTarget(Method method, Object target)` Constructor for a `null remainingBuffer` and `key`
    `MethodTarget(Method method, Object target, String remainingBuffer, String key)` Constructor that allows all fields to be set

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object other)`
    `String` | `getKey()`
    `Method` | `getMethod()`
    `String` | `getRemainingBuffer()`
    `Object` | `getTarget()`
    `int` | `hashCode()`
    `String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### MethodTarget

          public MethodTarget(Method method,
                      Object target)

      Constructor for a `null remainingBuffer` and `key`
      Parameters:
        `method` - the method to invoke (required)
        `target` - the object on which the method is to be invoked (required)
      Since:
        1.2.0

    - #### MethodTarget

          public MethodTarget(Method method,
                      Object target,
                      String remainingBuffer,
                      String key)

      Constructor that allows all fields to be set
      Parameters:
        `method` - the method to invoke (required)
        `target` - the object on which the method is to be invoked (required)
        `remainingBuffer` - can be blank
        `key` - can be blank
      Since:
        1.2.0

  - ### Method Detail

    - #### equals

          public boolean equals(Object other)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public final String toString()

      Overrides:
        `toString` in class `Object`

    - #### getKey

          public String getKey()

      Since:
        1.2.0

    - #### getMethod

          public Method getMethod()

      Returns:
        a non-`null` method
      Since:
        1.2.0

    - #### getRemainingBuffer

          public String getRemainingBuffer()

      Since:
        1.2.0

    - #### getTarget

          public Object getTarget()

      Returns:
        a non-`null` Object
      Since:
        1.2.0