Annotation Interface StatusCode


@Retention(RUNTIME) @Target({METHOD,ANNOTATION_TYPE}) public @interface StatusCode
An annotation which specifies a default HTTP status code of a response produced by an annotated HTTP service. If this annotation is missing, @StatusCode(200) or @StatusCode(204) would be applied according to the return type of the annotated method. If the return type is void or Void, @StatusCode(204) would be applied. Otherwise, @StatusCode(200) would be applied.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    int
    A default HTTP status code of a response produced by an annotated HTTP service.
  • Element Details

    • value

      int value
      A default HTTP status code of a response produced by an annotated HTTP service.