Package: groovy.transform

## [Java] Annotation Type NamedParam

- groovy.transform.NamedParam

-     @Documented
      @Retention(RetentionPolicy.RUNTIME)
      @Target(ElementType.PARAMETER)
      @Repeatable(NamedParams.class)
      public @interface NamedParam

  Marker interface used to indicate that the name of the annotated parameter (or specified optional name) is a valid key name when using named arguments and that the parameter type is applicable for type checking purposes.

  Since:
    2.5.0

- - ### Element Summary

    Optional Element Summary
    Type | Name and Description
    --- | ---
    `boolean` | `required` Indicates whether the named argument must be supplied.
    `Class` | `type` Returns the expected value type for the named argument.
    `String` | `value` Returns the accepted named-argument key.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Element Detail

    - #### public boolean required

      Indicates whether the named argument must be supplied. Defaults to `false`.

      Returns:
        `true` if the named argument is required
      Default:
        false

    - #### public Class type

      Returns the expected value type for the named argument. Defaults to Object.

      Returns:
        the named-argument type
      Default:
        Object.class

    - #### public String value

      Returns the accepted named-argument key. Defaults to Undefined.STRING, which indicates the annotated parameter name.

      Returns:
        the named-argument key
      Default:
        Undefined.STRING