java.lang.Object
net.i2p.router.web.GraphThemeColors.Entry
Enclosing class:
GraphThemeColors

private static final class GraphThemeColors.Entryextends Object
A theme's parsed declarations and the timestamps they were parsed from.

The timestamp is what makes a theme edit visible without a restart. The minigraph picks up a CSS change on page refresh because the browser re-reads the stylesheet; these colours are resolved on the server, so nothing would re-read them and an edit would otherwise need a router restart to show up.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final long
    When the theme file was last modified.
    (package private) final long
    When the theme file was parsed.
    (package private) final Map<String,String>
    The CSS variables parsed from the file.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Entry(long modified, long parsedAt, Map<String,String> variables)
    Caches one parsed theme file.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    (package private) boolean
    usable(long modified, long now)
    Whether the cached entry still matches its file.

    Methods inherited from class Object

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

    • modified

      final long modified
      When the theme file was last modified.
    • parsedAt

      final long parsedAt
      When the theme file was parsed.
    • variables

      final Map<String,String> variables
      The CSS variables parsed from the file.
  • Constructor Details

    • Entry

      Entry(long modified, long parsedAt, Map<String,String> variables)
      Caches one parsed theme file.
      Parameters:
      modified - when the file was last modified
      parsedAt - when the file was parsed
      variables - the parsed CSS variables
  • Method Details

    • usable

      boolean usable(long modified, long now)
      Whether the cached entry still matches its file.
      Parameters:
      modified - the file's current modified time
      now - the current time
      Returns:
      true if the entry matches the file and has not aged out