Class Directives


  • public class Directives
    extends java.lang.Object
    Collects all default directives into one class for simple importing of static functions.

    See Directives for ScalaDSL equivalent of this class.

    • Constructor Detail

      • Directives

        public Directives()
    • Method Detail

      • route

        public static Route route​(Route... alternatives)
      • getFromBrowseableDirectories

        public static Route getFromBrowseableDirectories​(java.lang.String... directories)
      • route

        public static Route route​(scala.collection.immutable.Seq<Route> alternatives)
        Deprecated.
      • getFromBrowseableDirectories

        public static Route getFromBrowseableDirectories​(scala.collection.immutable.Seq<java.lang.String> directories)
      • anyOf

        public static Route anyOf​(java.util.function.Function<java.util.function.Supplier<Route>,​Route> first,
                                  java.util.function.Function<java.util.function.Supplier<Route>,​Route> second,
                                  java.util.function.Supplier<Route> inner)
        Composes two 0-argument directives which share the same inner Route. This is equivalent to first(inner).orElse(second(inner)) Usage example: anyOf(this::get, this::post, () -> complete("hi")))
        Parameters:
        first - the first 0-argument directive
        second - the second 0-argument directive
        inner - the inner route Producer
        Returns:
        the resulting route
      • anyOf

        public static <A> Route anyOf​(java.util.function.Function<java.util.function.Function<A,​Route>,​Route> first,
                                      java.util.function.Function<java.util.function.Function<A,​Route>,​Route> second,
                                      java.util.function.Function<A,​Route> inner)
        Composes two 1-argument directives (directives whose inner route takes a parameter) which share the same inner route. This is the same as first(inner).orElse(second(inner)). This can be used also for directives that take an additional parameter if the directive is partially applied, ie. parameter Usage example: anyOf(bindParameter(this::path, "bar"), bindParameter(this::path, "baz"), () -> complete("bar or baz"))
        Parameters:
        first - the first 1-argument directive
        second - the second 1-argument directive
        inner - the inner route that takes one argument
        Returns:
        the resulting route
      • allOf

        public static Route allOf​(java.util.function.Function<java.util.function.Supplier<Route>,​Route> first,
                                  java.util.function.Function<java.util.function.Supplier<Route>,​Route> second,
                                  java.util.function.Supplier<Route> inner)
        Nests two 0-argument directives together Usage example: allOf(bindParameter(this::pathPrefix, "alice"), bindParameter(this::path, "bob"), () -> complete("Charlie!"))
        Parameters:
        first - the 0-argument directive (outer one)
        second - the 0-argument directive (inner one)
        inner - the inner route function
        Returns:
        the resulting route
      • allOf

        public static <A,​B> Route allOf​(java.util.function.Function<java.util.function.Function<A,​Route>,​Route> first,
                                              java.util.function.Function<java.util.function.Function<B,​Route>,​Route> second,
                                              java.util.function.BiFunction<A,​B,​Route> inner)
        Nests two 1-argument directives together Usage example: allOf(this::extractScheme, this::extractMethod, (scheme, method) -> complete("You did a " + method.name() + " using " + scheme))
        Parameters:
        first - the first 1-argument directive (outer one)
        second - the second 1-argument directive (inner one)
        inner - the inner route function that takes 2 different parameters
        Returns:
        the resulting route
      • allOf

        public static <A> Route allOf​(java.util.function.Function<java.util.function.Supplier<Route>,​Route> first,
                                      java.util.function.Function<java.util.function.Function<A,​Route>,​Route> second,
                                      java.util.function.Function<A,​Route> inner)
        Nests one 0-argument and 1-argument directives together Usage example: allOf(bindParameter(this::pathPrefix, "guess"), this::extractMethod, method -> complete("You did a " + method.name()))
        Parameters:
        first - the 0-argument directive (outer one)
        second - the 1-argument directive (inner one)
        inner - the inner route function that takes 1 parameter
        Returns:
        the resulting route
      • mapRejections

        public static Route mapRejections​(java.util.function.Function<java.util.List<Rejection>,​java.util.List<Rejection>> f,
                                          java.util.function.Supplier<Route> inner)
      • mapResponseHeaders

        public static Route mapResponseHeaders​(java.util.function.Function<java.util.List<HttpHeader>,​java.util.List<HttpHeader>> f,
                                               java.util.function.Supplier<Route> inner)
      • mapInnerRoute

        public static Route mapInnerRoute​(java.util.function.Function<Route,​Route> f,
                                          java.util.function.Supplier<Route> inner)
      • mapRouteResultFuture

        public static Route mapRouteResultFuture​(java.util.function.Function<java.util.concurrent.CompletionStage<RouteResult>,​java.util.concurrent.CompletionStage<RouteResult>> f,
                                                 java.util.function.Supplier<Route> inner)
      • mapRouteResultWith

        public static Route mapRouteResultWith​(java.util.function.Function<RouteResult,​java.util.concurrent.CompletionStage<RouteResult>> f,
                                               java.util.function.Supplier<Route> inner)
      • mapRouteResultWithPF

        public static Route mapRouteResultWithPF​(scala.PartialFunction<RouteResult,​java.util.concurrent.CompletionStage<RouteResult>> f,
                                                 java.util.function.Supplier<Route> inner)
      • pass

        public static Route pass​(java.util.function.Supplier<Route> inner)
      • provide

        public static <T> Route provide​(T t,
                                        java.util.function.Function<T,​Route> inner)
      • cancelRejection

        public static Route cancelRejection​(Rejection rejection,
                                            java.util.function.Supplier<Route> inner)
      • cancelRejections

        public static Route cancelRejections​(java.lang.Iterable<java.lang.Class<?>> classes,
                                             java.util.function.Supplier<Route> inner)
      • cancelRejections

        public static Route cancelRejections​(java.util.function.Predicate<Rejection> filter,
                                             java.util.function.Supplier<Route> inner)
      • recoverRejections

        public static Route recoverRejections​(java.util.function.Function<java.lang.Iterable<Rejection>,​RouteResult> f,
                                              java.util.function.Supplier<Route> inner)
      • recoverRejectionsWith

        public static Route recoverRejectionsWith​(java.util.function.Function<java.lang.Iterable<Rejection>,​java.util.concurrent.CompletionStage<RouteResult>> f,
                                                  java.util.function.Supplier<Route> inner)
      • mapUnmatchedPath

        public static Route mapUnmatchedPath​(java.util.function.Function<java.lang.String,​java.lang.String> f,
                                             java.util.function.Supplier<Route> inner)
      • extractUnmatchedPath

        public static RouteAdapter extractUnmatchedPath​(java.util.function.Function<java.lang.String,​Route> inner)
      • extractMatchedPath

        public static RouteAdapter extractMatchedPath​(java.util.function.Function<java.lang.String,​Route> inner)
      • extractUri

        public static RouteAdapter extractUri​(java.util.function.Function<Uri,​Route> inner)
      • extractMaterializer

        public static Route extractMaterializer​(java.util.function.Function<akka.stream.Materializer,​Route> inner)
      • extractActorSystem

        public static Route extractActorSystem​(java.util.function.Function<akka.actor.ActorSystem,​Route> inner)
      • extractExecutionContext

        public static Route extractExecutionContext​(java.util.function.Function<scala.concurrent.ExecutionContextExecutor,​Route> inner)
      • extract

        public static <T> Route extract​(java.util.function.Function<RequestContext,​T> extract,
                                        java.util.function.Function<T,​Route> inner)
      • withLog

        public static Route withLog​(akka.event.LoggingAdapter log,
                                    java.util.function.Supplier<Route> inner)
      • withExecutionContext

        public static Route withExecutionContext​(scala.concurrent.ExecutionContextExecutor ec,
                                                 java.util.function.Supplier<Route> inner)
      • withMaterializer

        public static Route withMaterializer​(akka.stream.Materializer mat,
                                             java.util.function.Supplier<Route> inner)
      • extractLog

        public static Route extractLog​(java.util.function.Function<akka.event.LoggingAdapter,​Route> inner)
      • extractDataBytes

        public static RouteAdapter extractDataBytes​(java.util.function.Function<akka.stream.javadsl.Source<akka.util.ByteString,​java.lang.Object>,​Route> inner)
      • extractRequestEntity

        public static Route extractRequestEntity​(java.util.function.Function<RequestEntity,​Route> inner)
      • extractStrictEntity

        public static Route extractStrictEntity​(scala.concurrent.duration.FiniteDuration timeout,
                                                java.util.function.Function<HttpEntity.Strict,​Route> inner)
      • extractStrictEntity

        public static Route extractStrictEntity​(scala.concurrent.duration.FiniteDuration timeout,
                                                long maxBytes,
                                                java.util.function.Function<HttpEntity.Strict,​Route> inner)
      • toStrictEntity

        public static Route toStrictEntity​(scala.concurrent.duration.FiniteDuration timeout,
                                           java.util.function.Supplier<Route> inner)
      • toStrictEntity

        public static Route toStrictEntity​(scala.concurrent.duration.FiniteDuration timeout,
                                           long maxBytes,
                                           java.util.function.Supplier<Route> inner)
      • conditional

        public static Route conditional​(EntityTag eTag,
                                        java.util.function.Supplier<Route> inner)
      • conditional

        public static Route conditional​(DateTime lastModified,
                                        java.util.function.Supplier<Route> inner)
      • conditional

        public static Route conditional​(java.util.Optional<EntityTag> eTag,
                                        java.util.Optional<DateTime> lastModified,
                                        java.util.function.Supplier<Route> inner)
      • responseEncodingAccepted

        public static Route responseEncodingAccepted​(HttpEncoding encoding,
                                                     java.util.function.Supplier<Route> inner)
      • encodeResponse

        public static Route encodeResponse​(java.util.function.Supplier<Route> inner)
      • encodeResponseWith

        public static Route encodeResponseWith​(java.lang.Iterable<Coder> coders,
                                               java.util.function.Supplier<Route> inner)
      • decodeRequestWith

        public static Route decodeRequestWith​(Coder coder,
                                              java.util.function.Supplier<Route> inner)
      • requestEncodedWith

        public static Route requestEncodedWith​(HttpEncoding encoding,
                                               java.util.function.Supplier<Route> inner)
      • decodeRequestWith

        public static Route decodeRequestWith​(java.lang.Iterable<Coder> coders,
                                              java.util.function.Supplier<Route> inner)
      • decodeRequest

        public static Route decodeRequest​(java.util.function.Supplier<Route> inner)
      • withPrecompressedMediaTypeSupport

        public static Route withPrecompressedMediaTypeSupport​(java.util.function.Supplier<Route> inner)
      • cookie

        public static Route cookie​(java.lang.String name,
                                   java.util.function.Function<HttpCookiePair,​Route> inner)
      • optionalCookie

        public static Route optionalCookie​(java.lang.String name,
                                           java.util.function.Function<java.util.Optional<HttpCookiePair>,​Route> inner)
      • setCookie

        public static Route setCookie​(HttpCookie cookie,
                                      java.util.function.Supplier<Route> inner)
      • setCookie

        public static Route setCookie​(java.lang.Iterable<HttpCookie> cookies,
                                      java.util.function.Supplier<Route> inner)
      • deleteCookie

        public static Route deleteCookie​(HttpCookie cookie,
                                         java.util.function.Supplier<Route> inner)
      • deleteCookie

        public static Route deleteCookie​(java.lang.Iterable<HttpCookie> cookies,
                                         java.util.function.Supplier<Route> inner)
      • deleteCookie

        public static Route deleteCookie​(java.lang.String name,
                                         java.util.function.Supplier<Route> inner)
      • deleteCookie

        public static Route deleteCookie​(java.lang.String name,
                                         java.lang.String domain,
                                         java.util.function.Supplier<Route> inner)
      • deleteCookie

        public static Route deleteCookie​(java.lang.String name,
                                         java.lang.String domain,
                                         java.lang.String path,
                                         java.util.function.Supplier<Route> inner)
      • logRequest

        public static Route logRequest​(java.lang.String marker,
                                       java.util.function.Supplier<Route> inner)
      • logRequest

        public static Route logRequest​(java.lang.String marker,
                                       akka.event.Logging.LogLevel level,
                                       java.util.function.Supplier<Route> inner)
      • logRequest

        public static Route logRequest​(java.util.function.Function<HttpRequest,​LogEntry> show,
                                       java.util.function.Supplier<Route> inner)
      • logResult

        public static Route logResult​(java.lang.String marker,
                                      java.util.function.Supplier<Route> inner)
      • logResult

        public static Route logResult​(java.lang.String marker,
                                      akka.event.Logging.LogLevel level,
                                      java.util.function.Supplier<Route> inner)
      • getFromResource

        public static Route getFromResource​(java.lang.String path)
      • getFromResource

        public static Route getFromResource​(java.lang.String path,
                                            ContentType contentType)
      • getFromResource

        public static Route getFromResource​(java.lang.String path,
                                            ContentType contentType,
                                            java.lang.ClassLoader classLoader)
      • getFromResourceDirectory

        public static Route getFromResourceDirectory​(java.lang.String directoryName)
      • getFromResourceDirectory

        public static Route getFromResourceDirectory​(java.lang.String directoryName,
                                                     java.lang.ClassLoader classLoader)
      • getFromResourceDirectory

        public static Route getFromResourceDirectory​(java.lang.String directoryName,
                                                     ContentTypeResolver resolver)
      • getFromResourceDirectory

        public static Route getFromResourceDirectory​(java.lang.String directoryName,
                                                     ContentTypeResolver resolver,
                                                     java.lang.ClassLoader classLoader)
      • getFromFile

        public static Route getFromFile​(java.io.File file)
      • getFromFile

        public static Route getFromFile​(java.io.File file,
                                        ContentType contentType)
      • getFromFile

        public static Route getFromFile​(java.lang.String file)
      • getFromDirectory

        public static Route getFromDirectory​(java.lang.String directoryPath)
      • getFromDirectory

        public static Route getFromDirectory​(java.lang.String directoryPath,
                                             ContentTypeResolver resolver)
      • getFromBrowseableDirectory

        public static Route getFromBrowseableDirectory​(java.lang.String directory,
                                                       DirectoryRenderer renderer)
      • getFromBrowseableDirectory

        public static Route getFromBrowseableDirectory​(java.lang.String directory,
                                                       ContentTypeResolver resolver)
      • getFromBrowseableDirectory

        public static Route getFromBrowseableDirectory​(java.lang.String directory)
      • listDirectoryContents

        public static Route listDirectoryContents​(scala.collection.immutable.Seq<java.lang.String> directories)
      • listDirectoryContents

        public static Route listDirectoryContents​(DirectoryRenderer directoryRenderer,
                                                  scala.collection.immutable.Seq<java.lang.String> directories)
      • defaultDirectoryRenderer

        public static DirectoryRenderer defaultDirectoryRenderer()
      • listDirectoryContents

        public static Route listDirectoryContents​(java.lang.String... directories)
      • listDirectoryContents

        public static Route listDirectoryContents​(DirectoryRenderer directoryRenderer,
                                                  java.lang.String... directories)
      • storeUploadedFile

        public static Route storeUploadedFile​(java.lang.String fieldName,
                                              java.util.function.Function<FileInfo,​java.io.File> destFn,
                                              java.util.function.BiFunction<FileInfo,​java.io.File,​Route> inner)
      • storeUploadedFiles

        public static Route storeUploadedFiles​(java.lang.String fieldName,
                                               java.util.function.Function<FileInfo,​java.io.File> destFn,
                                               java.util.function.Function<java.util.List<java.util.Map.Entry<FileInfo,​java.io.File>>,​Route> inner)
      • fileUpload

        public static Route fileUpload​(java.lang.String fieldName,
                                       java.util.function.BiFunction<FileInfo,​akka.stream.javadsl.Source<akka.util.ByteString,​java.lang.Object>,​Route> inner)
      • fileUploadAll

        public static Route fileUploadAll​(java.lang.String fieldName,
                                          java.util.function.Function<java.util.List<java.util.Map.Entry<FileInfo,​akka.stream.javadsl.Source<akka.util.ByteString,​java.lang.Object>>>,​Route> inner)
      • formField

        public static Route formField​(java.lang.String name,
                                      java.util.function.Function<java.lang.String,​Route> inner)
      • formFieldOptional

        public static Route formFieldOptional​(java.lang.String name,
                                              java.util.function.Function<java.util.Optional<java.lang.String>,​Route> inner)
      • formFieldList

        public static Route formFieldList​(java.lang.String name,
                                          java.util.function.Function<java.util.List<java.lang.String>,​Route> inner)
      • formField

        public static <T> Route formField​(Unmarshaller<java.lang.String,​T> t,
                                          java.lang.String name,
                                          java.util.function.Function<T,​Route> inner)
      • formFieldOptional

        public static <T> Route formFieldOptional​(Unmarshaller<java.lang.String,​T> t,
                                                  java.lang.String name,
                                                  java.util.function.Function<java.util.Optional<T>,​Route> inner)
      • formFieldList

        public static <T> Route formFieldList​(Unmarshaller<java.lang.String,​T> t,
                                              java.lang.String name,
                                              java.util.function.Function<java.util.List<T>,​Route> inner)
      • formFieldMap

        public static Route formFieldMap​(java.util.function.Function<java.util.Map<java.lang.String,​java.lang.String>,​Route> inner)
      • formFieldMultiMap

        public static Route formFieldMultiMap​(java.util.function.Function<java.util.Map<java.lang.String,​java.util.List<java.lang.String>>,​Route> inner)
      • formFieldList

        public static Route formFieldList​(java.util.function.Function<java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.String>>,​Route> inner)
      • onComplete

        public static <T> RouteAdapter onComplete​(java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> f,
                                                  java.util.function.Function<scala.util.Try<T>,​Route> inner)
      • onComplete

        public static <T> RouteAdapter onComplete​(java.util.concurrent.CompletionStage<T> cs,
                                                  java.util.function.Function<scala.util.Try<T>,​Route> inner)
      • onCompleteWithBreaker

        public static <T> RouteAdapter onCompleteWithBreaker​(akka.pattern.CircuitBreaker breaker,
                                                             java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> f,
                                                             java.util.function.Function<scala.util.Try<T>,​Route> inner)
      • onSuccess

        public static <T> RouteAdapter onSuccess​(java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> f,
                                                 java.util.function.Function<T,​Route> inner)
      • onSuccess

        public static <T> RouteAdapter onSuccess​(java.util.concurrent.CompletionStage<T> cs,
                                                 java.util.function.Function<T,​Route> inner)
      • completeOrRecoverWith

        public static <T> Route completeOrRecoverWith​(java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> f,
                                                      Marshaller<T,​RequestEntity> marshaller,
                                                      java.util.function.Function<java.lang.Throwable,​Route> inner)
      • checkSameOrigin

        public static Route checkSameOrigin​(HttpOriginRange allowed,
                                            java.util.function.Supplier<Route> inner)
      • headerValue

        public static <T> RouteAdapter headerValue​(java.util.function.Function<HttpHeader,​java.util.Optional<T>> f,
                                                   java.util.function.Function<T,​Route> inner)
      • headerValuePF

        public static <T> RouteAdapter headerValuePF​(scala.PartialFunction<HttpHeader,​T> pf,
                                                     java.util.function.Function<T,​Route> inner)
      • headerValueByName

        public static RouteAdapter headerValueByName​(java.lang.String headerName,
                                                     java.util.function.Function<java.lang.String,​Route> inner)
      • headerValueByType

        public static <T extends HttpHeaderRouteAdapter headerValueByType​(java.lang.Class<T> t,
                                                                            java.util.function.Function<T,​Route> inner)
      • optionalHeaderValue

        public static <T> RouteAdapter optionalHeaderValue​(java.util.function.Function<HttpHeader,​java.util.Optional<T>> f,
                                                           java.util.function.Function<java.util.Optional<T>,​Route> inner)
      • optionalHeaderValuePF

        public static <T> RouteAdapter optionalHeaderValuePF​(scala.PartialFunction<HttpHeader,​T> pf,
                                                             java.util.function.Function<java.util.Optional<T>,​Route> inner)
      • optionalHeaderValueByName

        public static RouteAdapter optionalHeaderValueByName​(java.lang.String headerName,
                                                             java.util.function.Function<java.util.Optional<java.lang.String>,​Route> inner)
      • optionalHeaderValueByType

        public static <T extends HttpHeaderRouteAdapter optionalHeaderValueByType​(java.lang.Class<T> t,
                                                                                    java.util.function.Function<java.util.Optional<T>,​Route> inner)
      • optionalAttribute

        public static <T> RouteAdapter optionalAttribute​(AttributeKey<T> key,
                                                         java.util.function.Function<java.util.Optional<T>,​Route> inner)
      • extractHost

        public static Route extractHost​(java.util.function.Function<java.lang.String,​Route> inner)
      • host

        public static Route host​(java.lang.Iterable<java.lang.String> hostNames,
                                 java.util.function.Supplier<Route> inner)
      • host

        public static Route host​(java.lang.String hostName,
                                 java.util.function.Supplier<Route> inner)
      • host

        public static Route host​(java.util.function.Predicate<java.lang.String> predicate,
                                 java.util.function.Supplier<Route> inner)
      • host

        public static Route host​(java.util.regex.Pattern regex,
                                 java.util.function.Function<java.lang.String,​Route> inner)
      • completeWith

        public static <T> Route completeWith​(Marshaller<T,​? extends HttpResponse> marshaller,
                                             java.util.function.Consumer<java.util.function.Consumer<T>> inner)
      • delete

        public static Route delete​(java.util.function.Supplier<Route> inner)
      • get

        public static Route get​(java.util.function.Supplier<Route> inner)
      • head

        public static Route head​(java.util.function.Supplier<Route> inner)
      • options

        public static Route options​(java.util.function.Supplier<Route> inner)
      • patch

        public static Route patch​(java.util.function.Supplier<Route> inner)
      • post

        public static Route post​(java.util.function.Supplier<Route> inner)
      • put

        public static Route put​(java.util.function.Supplier<Route> inner)
      • method

        public static Route method​(HttpMethod method,
                                   java.util.function.Supplier<Route> inner)
      • overrideMethodWithParameter

        public static Route overrideMethodWithParameter​(java.lang.String paramName,
                                                        java.util.function.Supplier<Route> inner)
      • validate

        public static Route validate​(java.util.function.BooleanSupplier check,
                                     java.lang.String errorMsg,
                                     java.util.function.Supplier<Route> inner)
      • extractClientIP

        public static Route extractClientIP​(java.util.function.Function<RemoteAddress,​Route> inner)
      • requestEntityEmpty

        public static Route requestEntityEmpty​(java.util.function.Supplier<Route> inner)
      • requestEntityPresent

        public static Route requestEntityPresent​(java.util.function.Supplier<Route> inner)
      • rejectEmptyResponse

        public static Route rejectEmptyResponse​(java.util.function.Supplier<Route> inner)
      • withSizeLimit

        public static Route withSizeLimit​(long maxBytes,
                                          java.util.function.Supplier<Route> inner)
      • withoutSizeLimit

        public static Route withoutSizeLimit​(java.util.function.Supplier<Route> inner)
      • selectPreferredLanguage

        public static Route selectPreferredLanguage​(java.lang.Iterable<Language> languages,
                                                    java.util.function.Function<Language,​Route> inner)
      • parameter

        public static Route parameter​(java.lang.String name,
                                      java.util.function.Function<java.lang.String,​Route> inner)
      • parameterOptional

        public static Route parameterOptional​(java.lang.String name,
                                              java.util.function.Function<java.util.Optional<java.lang.String>,​Route> inner)
      • parameterRequiredValue

        public static <T> Route parameterRequiredValue​(Unmarshaller<java.lang.String,​T> t,
                                                       T requiredValue,
                                                       java.lang.String name,
                                                       java.util.function.Supplier<Route> inner)
      • parameterList

        public static Route parameterList​(java.lang.String name,
                                          java.util.function.Function<java.util.List<java.lang.String>,​Route> inner)
      • parameter

        public static <T> Route parameter​(Unmarshaller<java.lang.String,​T> t,
                                          java.lang.String name,
                                          java.util.function.Function<T,​Route> inner)
      • parameterOptional

        public static <T> Route parameterOptional​(Unmarshaller<java.lang.String,​T> t,
                                                  java.lang.String name,
                                                  java.util.function.Function<java.util.Optional<T>,​Route> inner)
      • parameterOrDefault

        public static <T> Route parameterOrDefault​(Unmarshaller<java.lang.String,​T> t,
                                                   T defaultValue,
                                                   java.lang.String name,
                                                   java.util.function.Function<T,​Route> inner)
      • parameterList

        public static <T> Route parameterList​(Unmarshaller<java.lang.String,​T> t,
                                              java.lang.String name,
                                              java.util.function.Function<java.util.List<T>,​Route> inner)
      • parameterMap

        public static Route parameterMap​(java.util.function.Function<java.util.Map<java.lang.String,​java.lang.String>,​Route> inner)
      • parameterMultiMap

        public static Route parameterMultiMap​(java.util.function.Function<java.util.Map<java.lang.String,​java.util.List<java.lang.String>>,​Route> inner)
      • parameterList

        public static Route parameterList​(java.util.function.Function<java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.String>>,​Route> inner)
      • pathEnd

        public static Route pathEnd​(java.util.function.Supplier<Route> inner)
      • pathEndOrSingleSlash

        public static Route pathEndOrSingleSlash​(java.util.function.Supplier<Route> inner)
      • pathSingleSlash

        public static Route pathSingleSlash​(java.util.function.Supplier<Route> inner)
      • path

        public static Route path​(java.lang.String segment,
                                 java.util.function.Supplier<Route> inner)
      • path

        public static Route path​(java.util.function.Function<java.lang.String,​Route> inner)
      • path

        public static <T1,​T2> Route path​(PathMatcher2<T1,​T2> p,
                                               java.util.function.BiFunction<T1,​T2,​Route> inner)
      • pathPrefix

        public static Route pathPrefix​(java.lang.String segment,
                                       java.util.function.Supplier<Route> inner)
      • pathPrefix

        public static Route pathPrefix​(java.util.function.Function<java.lang.String,​Route> inner)
      • pathPrefix

        public static <T> Route pathPrefix​(PathMatcher1<T> p,
                                           java.util.function.Function<T,​Route> inner)
      • pathPrefix

        public static <T1,​T2> Route pathPrefix​(PathMatcher2<T1,​T2> p,
                                                     java.util.function.BiFunction<T1,​T2,​Route> inner)
      • rawPathPrefix

        public static Route rawPathPrefix​(java.lang.String segment,
                                          java.util.function.Supplier<Route> inner)
      • rawPathPrefix

        public static Route rawPathPrefix​(PathMatcher0 pm,
                                          java.util.function.Supplier<Route> inner)
      • rawPathPrefix

        public static <T1> Route rawPathPrefix​(PathMatcher1<T1> pm,
                                               java.util.function.Function<T1,​Route> inner)
      • rawPathPrefix

        public static <T1,​T2> Route rawPathPrefix​(PathMatcher2<T1,​T2> pm,
                                                        java.util.function.BiFunction<T1,​T2,​Route> inner)
      • pathPrefixTest

        public static Route pathPrefixTest​(java.lang.String segment,
                                           java.util.function.Supplier<Route> inner)
      • pathPrefixTest

        public static Route pathPrefixTest​(PathMatcher0 pm,
                                           java.util.function.Supplier<Route> inner)
      • pathPrefixTest

        public static <T1> Route pathPrefixTest​(PathMatcher1<T1> pm,
                                                java.util.function.Function<T1,​Route> inner)
      • pathPrefixTest

        public static <T1,​T2> Route pathPrefixTest​(PathMatcher2<T1,​T2> pm,
                                                         java.util.function.BiFunction<T1,​T2,​Route> inner)
      • rawPathPrefixTest

        public static Route rawPathPrefixTest​(java.lang.String segment,
                                              java.util.function.Supplier<Route> inner)
      • rawPathPrefixTest

        public static Route rawPathPrefixTest​(PathMatcher0 pm,
                                              java.util.function.Supplier<Route> inner)
      • rawPathPrefixTest

        public static <T1> Route rawPathPrefixTest​(PathMatcher1<T1> pm,
                                                   java.util.function.Function<T1,​Route> inner)
      • rawPathPrefixTest

        public static <T1,​T2> Route rawPathPrefixTest​(PathMatcher2<T1,​T2> pm,
                                                            java.util.function.BiFunction<T1,​T2,​Route> inner)
      • pathSuffix

        public static Route pathSuffix​(java.lang.String segment,
                                       java.util.function.Supplier<Route> inner)
      • pathSuffix

        public static <T1> Route pathSuffix​(PathMatcher1<T1> pm,
                                            java.util.function.Function<T1,​Route> inner)
      • pathSuffix

        public static <T1,​T2> Route pathSuffix​(PathMatcher2<T1,​T2> pm,
                                                     java.util.function.BiFunction<T1,​T2,​Route> inner)
      • pathSuffixTest

        public static Route pathSuffixTest​(java.lang.String segment,
                                           java.util.function.Supplier<Route> inner)
      • pathSuffixTest

        public static Route pathSuffixTest​(PathMatcher0 pm,
                                           java.util.function.Supplier<Route> inner)
      • pathSuffixTest

        public static <T1> Route pathSuffixTest​(PathMatcher1<T1> pm,
                                                java.util.function.Function<T1,​Route> inner)
      • pathSuffixTest

        public static <T1,​T2> Route pathSuffixTest​(PathMatcher2<T1,​T2> pm,
                                                         java.util.function.BiFunction<T1,​T2,​Route> inner)
      • redirectToTrailingSlashIfMissing

        public static Route redirectToTrailingSlashIfMissing​(StatusCode redirectionType,
                                                             java.util.function.Supplier<Route> inner)
      • redirectToNoTrailingSlashIfPresent

        public static Route redirectToNoTrailingSlashIfPresent​(StatusCode redirectionType,
                                                               java.util.function.Supplier<Route> inner)
      • pathPrefix

        public static <T> Route pathPrefix​(Unmarshaller<java.lang.String,​T> t,
                                           java.util.function.Function<T,​Route> inner)
      • path

        public static <T> Route path​(Unmarshaller<java.lang.String,​T> t,
                                     java.util.function.Function<T,​Route> inner)
      • ignoreTrailingSlash

        public static Route ignoreTrailingSlash​(java.util.function.Supplier<Route> inner)
      • withRangeSupport

        public static Route withRangeSupport​(java.util.function.Supplier<Route> inner)
      • respondWithHeader

        public static Route respondWithHeader​(HttpHeader responseHeader,
                                              java.util.function.Supplier<Route> inner)
      • respondWithDefaultHeader

        public static Route respondWithDefaultHeader​(HttpHeader responseHeader,
                                                     java.util.function.Supplier<Route> inner)
      • respondWithHeaders

        public static Route respondWithHeaders​(java.lang.Iterable<HttpHeader> responseHeaders,
                                               java.util.function.Supplier<Route> inner)
      • respondWithDefaultHeaders

        public static Route respondWithDefaultHeaders​(java.lang.Iterable<HttpHeader> responseHeaders,
                                                      java.util.function.Supplier<Route> inner)
      • concat

        public static Route concat​(Route first,
                                   scala.collection.immutable.Seq<Route> alternatives)
      • reject

        public static Route reject​(Rejection rejection,
                                   scala.collection.immutable.Seq<Rejection> rejections)
      • reject

        public static Route reject()
      • failWith

        public static Route failWith​(java.lang.Throwable error)
      • complete

        public static Route complete​(java.lang.String body)
      • completeWithFutureResponse

        public static RouteAdapter completeWithFutureResponse​(scala.concurrent.Future<HttpResponse> value)
      • completeOKWithFutureString

        public static RouteAdapter completeOKWithFutureString​(scala.concurrent.Future<java.lang.String> value)
      • completeWithFutureStatus

        public static Route completeWithFutureStatus​(scala.concurrent.Future<StatusCode> status)
      • completeWithFuture

        public static RouteAdapter completeWithFuture​(java.util.concurrent.CompletionStage<HttpResponse> value)
      • completeOKWithFuture

        public static RouteAdapter completeOKWithFuture​(java.util.concurrent.CompletionStage<RequestEntity> value)
      • completeOKWithFutureString

        public static RouteAdapter completeOKWithFutureString​(java.util.concurrent.CompletionStage<java.lang.String> value)
      • completeWithFutureStatus

        public static Route completeWithFutureStatus​(java.util.concurrent.CompletionStage<StatusCode> status)
      • handle

        public static Route handle​(akka.japi.function.Function<HttpRequest,​java.util.concurrent.CompletionStage<HttpResponse>> handler)
      • concat

        public static Route concat​(Route first,
                                   Route... alternatives)
      • extractScheme

        public static Route extractScheme​(java.util.function.Function<java.lang.String,​Route> inner)
      • scheme

        public static Route scheme​(java.lang.String name,
                                   java.util.function.Supplier<Route> inner)
      • extractCredentials

        public static Route extractCredentials​(java.util.function.Function<java.util.Optional<HttpCredentials>,​Route> inner)
      • authenticateBasic

        public static <T> Route authenticateBasic​(java.lang.String realm,
                                                  java.util.function.Function<java.util.Optional<SecurityDirectives.ProvidedCredentials>,​java.util.Optional<T>> authenticator,
                                                  java.util.function.Function<T,​Route> inner)
      • authenticateBasicPF

        public static <T> Route authenticateBasicPF​(java.lang.String realm,
                                                    scala.PartialFunction<java.util.Optional<SecurityDirectives.ProvidedCredentials>,​T> authenticator,
                                                    java.util.function.Function<T,​Route> inner)
      • authenticateBasicPFAsync

        public static <T> Route authenticateBasicPFAsync​(java.lang.String realm,
                                                         scala.PartialFunction<java.util.Optional<SecurityDirectives.ProvidedCredentials>,​java.util.concurrent.CompletionStage<T>> authenticator,
                                                         java.util.function.Function<T,​Route> inner)
      • authenticateBasicOptional

        public static <T> Route authenticateBasicOptional​(java.lang.String realm,
                                                          java.util.function.Function<java.util.Optional<SecurityDirectives.ProvidedCredentials>,​java.util.Optional<T>> authenticator,
                                                          java.util.function.Function<java.util.Optional<T>,​Route> inner)
      • authenticateBasicAsync

        public static <T> Route authenticateBasicAsync​(java.lang.String realm,
                                                       java.util.function.Function<java.util.Optional<SecurityDirectives.ProvidedCredentials>,​java.util.concurrent.CompletionStage<java.util.Optional<T>>> authenticator,
                                                       java.util.function.Function<T,​Route> inner)
      • authenticateBasicAsyncOptional

        public static <T> Route authenticateBasicAsyncOptional​(java.lang.String realm,
                                                               java.util.function.Function<java.util.Optional<SecurityDirectives.ProvidedCredentials>,​java.util.concurrent.CompletionStage<java.util.Optional<T>>> authenticator,
                                                               java.util.function.Function<java.util.Optional<T>,​Route> inner)
      • authenticateOAuth2

        public static <T> Route authenticateOAuth2​(java.lang.String realm,
                                                   java.util.function.Function<java.util.Optional<SecurityDirectives.ProvidedCredentials>,​java.util.Optional<T>> authenticator,
                                                   java.util.function.Function<T,​Route> inner)
      • authenticateOAuth2Optional

        public static <T> Route authenticateOAuth2Optional​(java.lang.String realm,
                                                           java.util.function.Function<java.util.Optional<SecurityDirectives.ProvidedCredentials>,​java.util.Optional<T>> authenticator,
                                                           java.util.function.Function<java.util.Optional<T>,​Route> inner)
      • authenticateOAuth2Async

        public static <T> Route authenticateOAuth2Async​(java.lang.String realm,
                                                        java.util.function.Function<java.util.Optional<SecurityDirectives.ProvidedCredentials>,​java.util.concurrent.CompletionStage<java.util.Optional<T>>> authenticator,
                                                        java.util.function.Function<T,​Route> inner)
      • authenticateOAuth2AsyncOptional

        public static <T> Route authenticateOAuth2AsyncOptional​(java.lang.String realm,
                                                                java.util.function.Function<java.util.Optional<SecurityDirectives.ProvidedCredentials>,​java.util.concurrent.CompletionStage<java.util.Optional<T>>> authenticator,
                                                                java.util.function.Function<java.util.Optional<T>,​Route> inner)
      • authenticateOrRejectWithChallenge

        public static <T> Route authenticateOrRejectWithChallenge​(java.util.function.Function<java.util.Optional<HttpCredentials>,​java.util.concurrent.CompletionStage<scala.util.Either<HttpChallenge,​T>>> authenticator,
                                                                  java.util.function.Function<T,​Route> inner)
      • authenticateOrRejectWithChallenge

        public static <C extends HttpCredentials,​T> Route authenticateOrRejectWithChallenge​(java.lang.Class<C> c,
                                                                                                  java.util.function.Function<java.util.Optional<C>,​java.util.concurrent.CompletionStage<scala.util.Either<HttpChallenge,​T>>> authenticator,
                                                                                                  java.util.function.Function<T,​Route> inner)
      • authorize

        public static Route authorize​(java.util.function.Supplier<java.lang.Object> check,
                                      java.util.function.Supplier<Route> inner)
      • authorizeWithRequestContext

        public static Route authorizeWithRequestContext​(akka.japi.function.Function<RequestContext,​java.lang.Object> check,
                                                        java.util.function.Supplier<Route> inner)
      • authorizeAsync

        public static Route authorizeAsync​(java.util.function.Supplier<java.util.concurrent.CompletionStage<java.lang.Object>> check,
                                           java.util.function.Supplier<Route> inner)
      • authorizeAsyncWithRequestContext

        public static Route authorizeAsyncWithRequestContext​(akka.japi.function.Function<RequestContext,​java.util.concurrent.CompletionStage<java.lang.Object>> check,
                                                             java.util.function.Supplier<Route> inner)
      • extractUpgradeToWebSocket

        public static Route extractUpgradeToWebSocket​(java.util.function.Function<UpgradeToWebSocket,​Route> inner)
      • extractWebSocketUpgrade

        public static Route extractWebSocketUpgrade​(java.util.function.Function<WebSocketUpgrade,​Route> inner)
      • extractOfferedWsProtocols

        public static Route extractOfferedWsProtocols​(java.util.function.Function<java.util.List<java.lang.String>,​Route> inner)
      • handleWebSocketMessages

        public static <T> Route handleWebSocketMessages​(akka.stream.javadsl.Flow<Message,​Message,​T> handler)
      • handleWebSocketMessagesForProtocol

        public static <T> Route handleWebSocketMessagesForProtocol​(akka.stream.javadsl.Flow<Message,​Message,​T> handler,
                                                                   java.lang.String subprotocol)
      • handleWebSocketMessagesForOptionalProtocol

        public static <T> Route handleWebSocketMessagesForOptionalProtocol​(akka.stream.javadsl.Flow<Message,​Message,​T> handler,
                                                                           java.util.Optional<java.lang.String> subprotocol)
      • extractRequestTimeout

        public static RouteAdapter extractRequestTimeout​(java.util.function.Function<scala.concurrent.duration.Duration,​Route> inner)
      • withRequestTimeout

        public static RouteAdapter withRequestTimeout​(scala.concurrent.duration.Duration timeout,
                                                      java.util.function.Supplier<Route> inner)
      • withRequestTimeout

        public static RouteAdapter withRequestTimeout​(scala.concurrent.duration.Duration timeout,
                                                      java.util.function.Function<HttpRequest,​HttpResponse> timeoutHandler,
                                                      java.util.function.Supplier<Route> inner)
      • withoutRequestTimeout

        public static RouteAdapter withoutRequestTimeout​(java.util.function.Supplier<Route> inner)
      • withRequestTimeoutResponse

        public static RouteAdapter withRequestTimeoutResponse​(java.util.function.Function<HttpRequest,​HttpResponse> timeoutHandler,
                                                              java.util.function.Supplier<Route> inner)
      • entityAsSourceOf

        public static <T> Route entityAsSourceOf​(Unmarshaller<akka.util.ByteString,​T> um,
                                                 EntityStreamingSupport support,
                                                 java.util.function.Function<akka.stream.javadsl.Source<T,​akka.NotUsed>,​Route> inner)
      • completeWithSource

        public static <T,​M> Route completeWithSource​(akka.stream.javadsl.Source<T,​M> source,
                                                           Marshaller<T,​akka.util.ByteString> m,
                                                           EntityStreamingSupport support)
      • cors

        public static Route cors​(java.util.function.Supplier<Route> inner)
      • extractSslSession

        public static Route extractSslSession​(java.util.function.Function<javax.net.ssl.SSLSession,​Route> inner)
      • extractClientCertificate

        public static Route extractClientCertificate​(java.util.function.Function<java.security.cert.X509Certificate,​Route> inner)
      • requireClientCertificateIdentity

        public static Route requireClientCertificateIdentity​(java.lang.String cnRegex,
                                                             java.util.function.Supplier<Route> inner)