Package groovy.transform
Annotation Interface NamedParam
@Documented
@Retention(RUNTIME)
@Target(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
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueReturns the accepted named-argument key. Defaults toUndefined.STRING, which indicates the annotated parameter name.- Returns:
- the named-argument key
- Default:
- "<DummyUndefinedMarkerString-DoNotUse>"
-
type
Class typeReturns the expected value type for the named argument. Defaults toObject.- Returns:
- the named-argument type
- Default:
- java.lang.Object.class
-
required
boolean requiredIndicates whether the named argument must be supplied. Defaults tofalse.- Returns:
trueif the named argument is required
- Default:
- false
-