java.lang.Object
org.klomp.snark.web.I2PSnarkServlet.SortHeaderContext
- Enclosing class:
I2PSnarkServlet
Request-derived inputs shared by every sortable torrent-list header cell; replaces a thirteen-parameter signature. Package-visible for testing.
Field Summary
FieldsModifier and TypeFieldDescription(package private) final StringCurrent sort key, may be null when unsorted.(package private) final StringActive status filter key, may be null when no filter is applied.(package private) final StringQuery string of the applied filters, preserved across sort links.(package private) final StringLink path prefix: contextPath with trailing '/'.(package private) final HttpServletRequestThe request the header links are built for.(package private) final booleanMore than one torrent is listed, so the columns are sortable.Constructor Summary
ConstructorsConstructorDescriptionSortHeaderContext(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.Method Summary
Field Details
req
The request the header links are built for.pathPrefix
Link path prefix: contextPath with trailing '/'.currentSort
Current sort key, may be null when unsorted.filterParam
Active status filter key, may be null when no filter is applied.filterQuery
Query string of the applied filters, preserved across sort links.showSort
final boolean showSortMore 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 forcontextPath- the servlet context path, without a trailing slashcurrentSort- the active sort key, may be nullfilterParam- the active status filter key, may be nullfilterQuery- the applied filters as a query stringshowSort- more than one torrent is listed