Class RouteDescription

java.lang.Object
org.apache.juneau.rest.server.beans.RouteDescription

@BeanType(properties="path,methods,summary,description,deprecated", findFluentSetters=true) @Response(schema=@Schema(ignore=true)) public class RouteDescription extends Object
Describes a single route (an @RestOp-annotated method) in a route-index listing.

Companion of ResourceDescription (which describes a child resource); a RouteDescription describes an operation mounted on a resource. Returned (as a RouteDescriptions list) by the route-index op so the response is content-negotiated through the configured serializers — an Accept: text/html request renders a browsable table with the path as a clickable link (via @Html(link)), while application/json / text/xml clients receive the same entries in their requested format.

The five serialized properties — path, methods, summary, description, and deprecated — preserve the JSON shape emitted by earlier route-index snapshots so existing API clients see an equivalent payload.

See Also:
Since:
10.0.0
  • Constructor Details

    • RouteDescription

      No-arg bean constructor.
    • RouteDescription

      public RouteDescription(String path, List<String> methods, String summary, String description, boolean deprecated)
      Constructor.
      Parameters:
      path - The mount path of the operation (e.g. "/items/{id}").
      methods - The HTTP methods the operation responds to (e.g. ["GET"]).
      summary - The operation summary, or an empty string when none is declared.
      description - The operation description, or an empty string when none is declared.
      deprecated - Whether the operation (or its declaring class) is @Deprecated.
  • Method Details

    • getPath

      @Html(link="servlet:{path}") public String getPath()
      Returns the mount path of the operation.

      Rendered as a clickable link in HTML output via @Html(link).

      Returns:
      The mount path.
    • path

      public RouteDescription path(String value)
      Sets the mount path of the operation.
      Parameters:
      value - The new value.
      Returns:
      This object.
    • getMethods

      public List<String> getMethods()
      Returns the HTTP methods the operation responds to.
      Returns:
      The HTTP methods.
    • methods

      Sets the HTTP methods the operation responds to.
      Parameters:
      value - The new value.
      Returns:
      This object.
    • getSummary

      public String getSummary()
      Returns the operation summary.
      Returns:
      The summary, or an empty string when none is declared.
    • summary

      Sets the operation summary.
      Parameters:
      value - The new value.
      Returns:
      This object.
    • getDescription

      Returns the operation description.
      Returns:
      The description, or an empty string when none is declared.
    • description

      Sets the operation description.
      Parameters:
      value - The new value.
      Returns:
      This object.
    • isDeprecated

      public boolean isDeprecated()
      Returns whether the operation is deprecated.
      Returns:
      true if the operation (or its declaring class) is @Deprecated.
    • deprecated

      public RouteDescription deprecated(boolean value)
      Sets whether the operation is deprecated.
      Parameters:
      value - The new value.
      Returns:
      This object.