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

private static class I2PSnarkServlet.RowContextextends Object
Per-row and per-render inputs for I2PSnarkServlet.displaySnark(PrintWriter, I2PSnarkServlet.RowContext, StringBuilder), replacing an eighteen-parameter signature. Immutable view over render-scope state.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final Map<ByteArray, I2PSnarkServlet.BadgeInfo>
    Per-render cache of badge lookups keyed by info hash, shared by every RowContext of the current response; single-threaded.
    (package private) final boolean
    Whether the user may change this torrent.
    (package private) final String
    Active filter value, "" for none; never null.
    (package private) final int
    Zero-based index within the current page; drives parity styling.
    (package private) final boolean
    Whether thin spaces are omitted in numbers.
    (package private) final boolean
    Whether the peer list is shown.
    (package private) final Snark
    The torrent whose row is being drawn.
    (package private) final String
    Normalized sort parameter, or null.
    (package private) final long[]
    Render-scope accumulator; reference is shared, contents mutate.
    (package private) final String
    Short unique action token stamped on this row's form controls, resolved once by the caller from the render-scope map built by ActionTokens.mint(Collection); falls back to the full b64 name.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RowContext(Snark snark, int index, boolean showPeers, long[] stats, boolean noThinsp, boolean canWrite, String filterParam, String sortParam, Map<ByteArray, I2PSnarkServlet.BadgeInfo> badgeCache, String token)
    Holds what one download row needs.
  • Method Summary

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • snark

      final Snark snark
      The torrent whose row is being drawn.
    • index

      final int index
      Zero-based index within the current page; drives parity styling.
    • showPeers

      final boolean showPeers
      Whether the peer list is shown.
    • stats

      final long[] stats
      Render-scope accumulator; reference is shared, contents mutate.
    • noThinsp

      final boolean noThinsp
      Whether thin spaces are omitted in numbers.
    • canWrite

      final boolean canWrite
      Whether the user may change this torrent.
    • filterParam

      final String filterParam
      Active filter value, "" for none; never null.
    • sortParam

      final String sortParam
      Normalized sort parameter, or null.
    • badgeCache

      Per-render cache of badge lookups keyed by info hash, shared by every RowContext of the current response; single-threaded.
    • token

      final String token
      Short unique action token stamped on this row's form controls, resolved once by the caller from the render-scope map built by ActionTokens.mint(Collection); falls back to the full b64 name.
  • Constructor Details

    • RowContext

      RowContext(Snark snark, int index, boolean showPeers, long[] stats, boolean noThinsp, boolean canWrite, String filterParam, String sortParam, Map<ByteArray, I2PSnarkServlet.BadgeInfo> badgeCache, String token)
      Holds what one download row needs.
      Parameters:
      snark - the download the row describes
      index - the number of the row
      showPeers - true to show the peer counts
      stats - the stats of the row
      noThinsp - true to skip the thin separators
      canWrite - true if the user may change the download
      filterParam - the current filter parameter
      sortParam - the current sort parameter
      badgeCache - the cached badge info
      token - the security token of the form