Interface StatusRoute

All Superinterfaces:
MethodBasedRoute, Route

public interface StatusRoute extends MethodBasedRoute
Represents a Route that matches a status.
Since:
1.0
Author:
Graeme Rocher
  • Method Details

    • originatingType

      @Nullable Class<?> originatingType()
      Returns:
      The type the exception originates from. Null if the error route is global.
    • status

      HttpStatus status()
      Returns:
      The status
    • match

      <T> Optional<RouteMatch<T>> match(HttpStatus status)
      Match the given HTTP status.
      Type Parameters:
      T - The matched route
      Parameters:
      status - The status to match
      Returns:
      The route match
    • match

      <T> Optional<RouteMatch<T>> match(Class<?> originatingClass, HttpStatus status)
      Match the given HTTP status.
      Type Parameters:
      T - The matched route
      Parameters:
      originatingClass - The class where the error originates from
      status - The status to match
      Returns:
      The route match
    • consumes

      StatusRoute consumes(MediaType... mediaType)
      Description copied from interface: Route
      Applies the given accepted media type the route.
      Specified by:
      consumes in interface Route
      Parameters:
      mediaType - The media type
      Returns:
      A new route with the media type applied
    • nest

      StatusRoute nest(Runnable nested)
      Description copied from interface: Route
      Defines routes nested within this route.
      Specified by:
      nest in interface Route
      Parameters:
      nested - The nested routes
      Returns:
      This route
    • where

      StatusRoute where(Predicate<HttpRequest<?>> condition)
      Description copied from interface: Route
      Match this Route only if the given predicate is true.
      Specified by:
      where in interface Route
      Parameters:
      condition - The condition which accepts a HttpRequest
      Returns:
      This route