Class APIPath

  • All Implemented Interfaces:
    Serializable

    @Immutable
    @MustImplementEqualsAndHashcode
    public class APIPath
    extends Object
    implements Serializable
    This class contains a combination of path and HTTP method.
    Author:
    Philip Helger
    See Also:
    Serialized Form
    • Constructor Detail

      • APIPath

        public APIPath​(@Nonnull
                       com.helger.commons.http.EHttpMethod eHttpMethod,
                       @Nonnull @Nonempty
                       String sPath)
        Constructor
        Parameters:
        eHttpMethod - The HTTP method to be used. May not be null.
        sPath - The path relative to the owning servlet.
    • Method Detail

      • getHttpMethod

        @Nonnull
        public com.helger.commons.http.EHttpMethod getHttpMethod()
        Returns:
        The HTTP method as provided in the constructor. Never null.
      • getPath

        @Nonnull
        @Nonempty
        public String getPath()
        Returns:
        The path as provided in the constructor. Neither null nor empty.
      • getInvocationURL

        @Nonnull
        public com.helger.commons.url.SimpleURL getInvocationURL​(@Nonnull
                                                                 String sBasePath)
        Get the invocation URL of this API path.
        Parameters:
        sBasePath - The HTTP base path of the server (e.g. http://www.example.org/api"), which is prepended to the relative path of this object. May not be null but maybe empty (since v8.1.4)
        Returns:
        The new URL. Never null.
        See Also:
        getPath()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • createForFilter

        @Nonnull
        public static APIPath createForFilter​(@Nonnull
                                              com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)
      • createForServlet

        @Nonnull
        public static APIPath createForServlet​(@Nonnull
                                               com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)