Interface RouteMatch<R>

Type Parameters:
R - The route
All Superinterfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource, Callable<R>
All Known Subinterfaces:
MethodBasedRouteMatch<T,R>, UriRouteMatch<T,R>

public interface RouteMatch<R> extends Callable<R>, io.micronaut.core.annotation.AnnotationMetadataProvider
A Route that is executable.
Since:
1.0
  • Field Summary

    Fields inherited from interface io.micronaut.core.annotation.AnnotationSource

    EMPTY
  • Method Summary

    Modifier and Type
    Method
    Description
    default R
    Same as execute().
    Execute the route with the given values.
    void
    fulfill(Map<String,Object> argumentValues)
    Fulfill argument values.
    void
    fulfillAfterFilters(io.micronaut.http.bind.RequestBinderRegistry requestBinderRegistry, io.micronaut.http.HttpRequest<?> request)
    Attempt to satisfy the arguments of the given route with the data from the given request.
    void
    fulfillBeforeFilters(io.micronaut.http.bind.RequestBinderRegistry requestBinderRegistry, io.micronaut.http.HttpRequest<?> request)
    Attempt to satisfy the arguments of the given route with the data from the given request.
    default Collection<io.micronaut.core.type.Argument<?>>
    Returns the required arguments for this RouteMatch.
    Optional<io.micronaut.core.type.Argument<?>>
    Return whether the given named input is required by this route.
     
     
    boolean
     
    boolean
    Is the given input satisfied.

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider

    findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType

    Methods inherited from interface io.micronaut.core.annotation.AnnotationSource

    getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
  • Method Details

    • getRouteInfo

      RouteInfo<R> getRouteInfo()
      Returns:
      The route info
    • getVariableValues

      Map<String,Object> getVariableValues()
      Returns:
      The variable values following a successful match.
    • fulfill

      void fulfill(Map<String,Object> argumentValues)
      Fulfill argument values.
      Parameters:
      argumentValues - The argument values
    • fulfillBeforeFilters

      void fulfillBeforeFilters(io.micronaut.http.bind.RequestBinderRegistry requestBinderRegistry, io.micronaut.http.HttpRequest<?> request)
      Attempt to satisfy the arguments of the given route with the data from the given request.
      Parameters:
      requestBinderRegistry - The request binder registry
      request - The request
      Since:
      4.0.0
    • fulfillAfterFilters

      void fulfillAfterFilters(io.micronaut.http.bind.RequestBinderRegistry requestBinderRegistry, io.micronaut.http.HttpRequest<?> request)
      Attempt to satisfy the arguments of the given route with the data from the given request.
      Parameters:
      requestBinderRegistry - The request binder registry
      request - The request
      Since:
      4.0.0
    • isFulfilled

      boolean isFulfilled()
      Returns:
      Whether the route match can be executed without passing any additional arguments i.e. via execute()
      Since:
      4.0.0
    • getRequiredInput

      Optional<io.micronaut.core.type.Argument<?>> getRequiredInput(String name)
      Return whether the given named input is required by this route.
      Parameters:
      name - The name of the input
      Returns:
      True if it is
    • getRequiredArguments

      default Collection<io.micronaut.core.type.Argument<?>> getRequiredArguments()

      Returns the required arguments for this RouteMatch.

      Returns:
      The required arguments in order to invoke this route
    • execute

      R execute()
      Execute the route with the given values. Note if there are required arguments returned from getRequiredArguments() this method will throw an IllegalArgumentException.
      Returns:
      The result
    • call

      default R call() throws Exception
      Same as execute().
      Specified by:
      call in interface Callable<R>
      Returns:
      The result
      Throws:
      Exception - When an exception occurs
    • isSatisfied

      boolean isSatisfied(String name)
      Is the given input satisfied.
      Parameters:
      name - The name of the input
      Returns:
      True if it is