Annotation Type Param


@Target({PARAMETER,FIELD}) @Retention(RUNTIME) @Documented public @interface Param
Annotation for defining parameters on Dubbo service method parameters. Provides metadata such as parameter type, default value, and whether the parameter is required.

Example usage:

 @Param(value = "x-version", type = ParamType.Header, required = false) String version
 
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specifies a default value for the parameter.
    boolean
    Indicates whether the parameter is required.
    The type of the parameter, such as query, header, or path variable.
    The name of the parameter.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Field Details

  • Element Details

    • value

      String value
      The name of the parameter. If not specified, the parameter name is derived from the method signature or field name.
      Default:
      ""
    • type

      ParamType type
      The type of the parameter, such as query, header, or path variable. Defaults to ParamType.Param.
      Default:
      Param
    • required

      boolean required
      Indicates whether the parameter is required. Defaults to true. If set to false, the parameter is optional.
      Default:
      true
    • defaultValue

      String defaultValue
      Specifies a default value for the parameter. Defaults to DEFAULT_NONE, indicating that there is no default value.
      Default:
      "\n\t\t\n\t\t\n_DEFAULT_NONE_\n\t\t\t\t\n"