java.lang.Object
org.klomp.snark.web.I2PSnarkServlet.SortHeaderContext
Enclosing class:
I2PSnarkServlet

static class I2PSnarkServlet.SortHeaderContextextends Object
Request-derived inputs shared by every sortable torrent-list header cell; replaces a thirteen-parameter signature. Package-visible for testing.
  • Field Details

    • req

      final HttpServletRequest req
      The request the header links are built for.
    • pathPrefix

      final String pathPrefix
      Link path prefix: contextPath with trailing '/'.
    • currentSort

      final String currentSort
      Current sort key, may be null when unsorted.
    • filterParam

      final String filterParam
      Active status filter key, may be null when no filter is applied.
    • filterQuery

      final String filterQuery
      Query string of the applied filters, preserved across sort links.
    • showSort

      final boolean showSort
      More than one torrent is listed, so the columns are sortable.
  • Constructor Details

    • SortHeaderContext

      SortHeaderContext(HttpServletRequest req, String contextPath, String currentSort, String filterParam, String filterQuery, boolean showSort)
      Builds the context from the header's caller inputs, deriving pathPrefix from contextPath.
      Parameters:
      req - the request the header links are built for
      contextPath - the servlet context path, without a trailing slash
      currentSort - the active sort key, may be null
      filterParam - the active status filter key, may be null
      filterQuery - the applied filters as a query string
      showSort - more than one torrent is listed