Interface UriRouteInfo<T,R>

Type Parameters:
T - The target
R - The result
All Superinterfaces:
AnnotationMetadataProvider, AnnotationSource, Comparable<UriRouteInfo<T,R>>, MethodBasedRouteInfo<T,R>, RequestMatcher, RouteInfo<R>, UriMatcher
All Known Implementing Classes:
DefaultUrlRouteInfo

public interface UriRouteInfo<T,R> extends MethodBasedRouteInfo<T,R>, RequestMatcher, UriMatcher, Comparable<UriRouteInfo<T,R>>
Represents a Route that matches a URI.
Since:
4.0.0
Author:
Denis Stepanov
  • Method Details

    • getHttpMethod

      HttpMethod getHttpMethod()
      Returns:
      The HTTP method for this route
    • getUriMatchTemplate

      UriMatchTemplate getUriMatchTemplate()
      Returns:
      The UriMatchTemplate used to match URIs
    • match

      default Optional<UriRouteMatch<T,R>> match(URI uri)
      Match this route within the given URI and produce a RouteMatch if a match is found.
      Specified by:
      match in interface UriMatcher
      Parameters:
      uri - The URI
      Returns:
      An Optional of RouteMatch
    • tryMatch

      default @Nullable UriRouteMatch<T,R> tryMatch(URI uri)
      Match this route within the given URI and produce a RouteMatch if a match is found.
      Parameters:
      uri - The URI
      Returns:
      A null or a RouteMatch
    • match

      Match this route within the given URI and produce a RouteMatch if a match is found.
      Specified by:
      match in interface UriMatcher
      Parameters:
      uri - The URI
      Returns:
      An Optional of RouteMatch
    • tryMatch

      @Nullable UriRouteMatch<T,R> tryMatch(String uri)
      Match this route within the given URI and produce a RouteMatch if a match is found.
      Parameters:
      uri - The URI
      Returns:
      A null or a RouteMatch
    • getPort

      @Nullable Integer getPort()
      Returns:
      The port the route listens to, or null if the default port
    • getHttpMethodName

      default String getHttpMethodName()
      Returns:
      The http method. Is equal to getHttpMethod() value for standard http methods.
    • isImplicitHead

      default boolean isImplicitHead()
      Whether this route is an implicit HEAD route; that is, a HEAD route that was derived automatically from a Get mapping rather than declared by the user with Head.

      Implicit routes are fully-fledged routes and participate in matching and content negotiation exactly like any other route. The distinction is only used as a last-resort tie-break: if a request cannot be resolved to a single route and the remaining candidates contain both implicit and explicitly declared routes, the explicitly declared ones win instead of the request being rejected as ambiguous.

      Returns:
      true if this route was derived from a @Get mapping rather than declared
      Since:
      5.2.0