Package: groovy.lang

## [Java] Class IncorrectClosureArgumentsException

- groovy.lang.IncorrectClosureArgumentsException

-     public class IncorrectClosureArgumentsException
      extends GroovyRuntimeException

  An exception occurred when invoking a Closure with the wrong number and/or types of arguments

- - ### Constructor Summary

    Constructors
    Constructor and description
    `IncorrectClosureArgumentsException(Closure closure, Object arguments, Class[] expected)` Creates an exception describing mismatched closure arguments.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Object` | `getArguments()` Returns the supplied arguments.
    `` | `public Closure` | `getClosure()` Returns the target closure.
    `` | `public Class[]` | `getExpected()` Returns the expected parameter types.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class GroovyRuntimeException` | `getLocationText, getMessage, getMessageWithoutLocationText, getModule, getNode, setModule`

- - ### Constructor Detail

    - #### public IncorrectClosureArgumentsException(Closure closure, Object arguments, Class[] expected)

      Creates an exception describing mismatched closure arguments.

      Parameters:
        `closure` - the target closure
        `arguments` - the supplied arguments
        `expected` - the expected parameter types

  - ### Method Detail

    - #### public Object getArguments()

      Returns the supplied arguments.

      Returns:
        the supplied arguments

    - #### public Closure getClosure()

      Returns the target closure.

      Returns:
        the target closure

    - #### public Class[] getExpected()

      Returns the expected parameter types.

      Returns:
        the expected parameter types