Class Routers


  • final class Routers
    extends java.lang.Object
    Routing tree assembly utilities.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  Routers.EndpointRouter  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Routers()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Router endpoint​(Endpoint endpoint)
      Creates a terminal Router that wraps the given endpoint.
      static Endpoint extractEndpoint​(Router router)
      Extract endpoint stored in a router (if any).
      static Router noop()
      Create a terminal "no-op router" that accepts any input context and returns the unchanged request and an empty continuation iterator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • IDENTITY_ROUTER

        private static final Router IDENTITY_ROUTER
    • Constructor Detail

      • Routers

        private Routers()
    • Method Detail

      • noop

        public static Router noop()
        Create a terminal "no-op router" that accepts any input context and returns the unchanged request and an empty continuation iterator.
        Returns:
        a terminal "no-op" router.
      • extractEndpoint

        public static Endpoint extractEndpoint​(Router router)
        Extract endpoint stored in a router (if any).
        Parameters:
        router - router from which a server endpoint should be extracted.
        Returns:
        extracted endpoint or null if there was no endpoint stored in the router.