Package ej.hoka.http

Class Route


  • public class Route
    extends java.lang.Object
    Represent an HTTP route.
    • Constructor Summary

      Constructors 
      Constructor Description
      Route​(int httpMethod, java.lang.String path, RequestHandler handler)
      Constructs a new instance of Route.
      Route​(int httpMethod, java.lang.String path, java.lang.String acceptType, RequestHandler handler)
      Constructs a new instance of Route.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean acceptAllContentTypes()
      Checks if this route accepts all content types.
      boolean equals​(java.lang.Object obj)  
      java.lang.String getAcceptType()
      Gets the acceptType.
      RequestHandler getHandler()
      Gets the request handler associated with this route.
      int getHttpMethod()
      Gets the integer value associated with the HTTP method of the route.
      java.lang.String getHttpMethodAsString()
      Returns the HTTP method of this route as a String.
      java.lang.String getPath()
      Gets the path (URI) mapped in this route.
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getPath

        public java.lang.String getPath()
        Gets the path (URI) mapped in this route.
        Returns:
        the path (URI) mapped in this route.
      • getAcceptType

        @Nullable
        public java.lang.String getAcceptType()
        Gets the acceptType.
        Returns:
        the acceptType.
      • getHandler

        public RequestHandler getHandler()
        Gets the request handler associated with this route.
        Returns:
        the request handler associated with this route.
      • acceptAllContentTypes

        public boolean acceptAllContentTypes()
        Checks if this route accepts all content types.
        Returns:
        true if this route accepts all content types.
      • getHttpMethodAsString

        public java.lang.String getHttpMethodAsString()
        Returns the HTTP method of this route as a String.
        Returns:
        http method as string
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object