Module io.jooby
Package io.jooby

Class RouteSet

java.lang.Object
io.jooby.RouteSet

public class RouteSet extends Object
Give you access to all routes created inside a Router.path(String, Runnable). Allow to globally apply attributes or metadata.
Since:
2.7.3
Author:
edgar
  • Constructor Details

    • RouteSet

      public RouteSet()
  • Method Details

    • getRoutes

      @NonNull public List<Route> getRoutes()
      Sub-routes. Always empty except when used it from Router.path(String, Runnable) or Router.routes(Runnable).
      Returns:
      Sub-routes.
    • setRoutes

      @NonNull public RouteSet setRoutes(@NonNull List<Route> routes)
      Set sub-routes.
      Parameters:
      routes - Sub-routes.
      Returns:
      This route.
    • produces

      @NonNull public RouteSet produces(@NonNull MediaType... produces)
      Add one or more response types (format) produces by this route.
      Parameters:
      produces - Produce types.
      Returns:
      This route.
    • setProduces

      @NonNull public RouteSet setProduces(@NonNull Collection<MediaType> produces)
      Add one or more response types (format) produces by this route.
      Parameters:
      produces - Produce types.
      Returns:
      This route.
    • consumes

      @NonNull public RouteSet consumes(@NonNull MediaType... consumes)
      Add one or more request types (format) consumed by this route.
      Parameters:
      consumes - Consume types.
      Returns:
      This route.
    • setConsumes

      @NonNull public RouteSet setConsumes(@NonNull Collection<MediaType> consumes)
      Add one or more request types (format) consumed by this route.
      Parameters:
      consumes - Consume types.
      Returns:
      This route.
    • setAttributes

      @NonNull public RouteSet setAttributes(@NonNull Map<String,Object> attributes)
      Add one or more attributes applied to this route.
      Parameters:
      attributes - .
      Returns:
      This route.
    • attribute

      @NonNull public RouteSet attribute(@NonNull String name, @NonNull Object value)
      Add one or more attributes applied to this route.
      Parameters:
      name - attribute name
      value - attribute value
      Returns:
      This route.
    • setExecutorKey

      @NonNull public RouteSet setExecutorKey(@Nullable String executorKey)
      Set executor key. The route is going to use the given key to fetch an executor. Possible values are:

      - null: no specific executor, uses the default Jooby logic to choose one, based on the value of ExecutionMode; - worker: use the executor provided by the server. - arbitrary name: use an named executor which as registered using Router.executor(String, Executor).

      Parameters:
      executorKey - Executor key.
      Returns:
      This route.
    • getTags

      @NonNull public List<String> getTags()
      Route tags.
      Returns:
      Route tags.
    • setTags

      @NonNull public RouteSet setTags(@NonNull List<String> tags)
      Tag this route. Tags are used for documentation purpose from openAPI generator.
      Parameters:
      tags - Tags.
      Returns:
      This route.
    • tags

      @NonNull public RouteSet tags(@NonNull String... tags)
      Tag this route. Tags are used for documentation purpose from openAPI generator.
      Parameters:
      tags - Tags.
      Returns:
      This route.
    • getSummary

      @Nullable public String getSummary()
      Route summary useful for documentation purpose from openAPI generator.
      Returns:
      Summary.
    • summary

      @NonNull public RouteSet summary(@Nullable String summary)
      Route summary useful for documentation purpose from openAPI generator.
      Parameters:
      summary - Summary.
      Returns:
      This route.
    • setSummary

      @NonNull public RouteSet setSummary(@Nullable String summary)
      Route summary useful for documentation purpose from openAPI generator.
      Parameters:
      summary - Summary.
      Returns:
      This route.
    • getDescription

      @Nullable public String getDescription()
      Route description useful for documentation purpose from openAPI generator.
      Returns:
      Route description.
    • setDescription

      @NonNull public RouteSet setDescription(@Nullable String description)
      Route description useful for documentation purpose from openAPI generator.
      Parameters:
      description - Description.
      Returns:
      This route.
    • description

      @NonNull public RouteSet description(@Nullable String description)
      Route description useful for documentation purpose from openAPI generator.
      Parameters:
      description - Description.
      Returns:
      This route.