Annotation Type RemoteGet


Annotation applied to Java methods on REST proxy interface classes.

Note that this annotation is optional if you do not need to override any of the values.

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    REST service path.
    The value the remote method returns.
    REST path.
  • Element Details

    • path

      REST service path.

      If you do not specify a path, then the path is inferred from the Java method name.

      Example:

      // POST /pet @RemoteGet public Pet getPet(...);

      Note that you can also use value() to specify the method name and path in shortened form.

      • An absolute URL.
      • A relative URL interpreted as relative to the root URL defined on the RestClient and/or Remote.path().
      • No path.
      Returns:
      The annotation value.
      Default:
      ""
    • returns

      The value the remote method returns.
      • RemoteReturn.BODY (default) - The body of the HTTP response converted to a POJO.
        The return type on the Java method can be any of the following:
        • void - Don't parse any response. Note that the method will still throw an exception if an error HTTP status is returned.
        • Any parsable POJO - The body of the response will be converted to the POJO using the parser defined on the RestClient.
        • Any POJO annotated with the @Response annotation. This allows for response beans to be used which also allows for OpenAPI-based parsing and validation.
        • HttpResponse - Returns the raw HttpResponse returned by the inner HttpClient.
        • Reader - Returns access to the raw reader of the response.
        • InputStream - Returns access to the raw input stream of the response.
      • RemoteReturn.STATUS - The HTTP status code on the response.
        The return type on the Java method can be any of the following:
        • int/Integer - The HTTP response code.
        • boolean/Boolean - true if the response code is <400
      Returns:
      The annotation value.
      Default:
      BODY
    • value

      REST path.

      Can be used to provide a shortened form for the path() value.

      The following examples are considered equivalent.

      // Normal form @RemoteGet(path="/{propertyName}") // Shortened form @RemoteGet("/{propertyName}")

      Returns:
      The annotation value.
      Default:
      ""