Enum Class ContractRule

java.lang.Object
java.lang.Enum<ContractRule>
com.arc_e_tect.gradle.trackerlens.contract.ContractRule
All Implemented Interfaces:
Serializable, Comparable<ContractRule>, Constable

public enum ContractRule extends Enum<ContractRule>
The tracker-lens dashboard content contract: the single source of truth for which structural elements a generated dashboard.html must contain, so a lens's CSS has stable selectors to style against.

Every rule here governs a data-bound element - one rendered from a LifecycleRecord or a Projection, such as a metric's value, a stale item's name, or a chart's series. Its class names, data-* attributes, and position are the contract and must not change casually across versions. Surrounding text - headings, captions, labels - is never part of this contract and is free to reword at any time: no rule here, and no lens's CSS, should ever select on literal text.

LensContractValidator enforces every rule below against a generated dashboard, and DASHBOARD-THEMING.adoc is tested for consistency against this enum, so the two can never drift apart.

  • Enum Constant Details

    • DASHBOARD_ROOT

      public static final ContractRule DASHBOARD_ROOT
      The single root element wrapping the entire dashboard.
    • TRACKER_SECTION

      public static final ContractRule TRACKER_SECTION
      One section per registered tracker.
    • METRIC_CARD

      public static final ContractRule METRIC_CARD
      One metric card per stage, within each tracker section.
    • METRIC_CARD_PERCENT_HOOK

      public static final ContractRule METRIC_CARD_PERCENT_HOOK
      Every metric card also carries the --percent custom-property styling hook.
    • PROJECTION_BLOCK

      public static final ContractRule PROJECTION_BLOCK
      At most one projection block per tracker section (absent when no projection is available).
    • CHART_CANVAS

      public static final ContractRule CHART_CANVAS
      One chart canvas per tracker section.
    • STALE_TABLE

      public static final ContractRule STALE_TABLE
      At most one stale-items table for the whole dashboard.
    • LENS_SWITCHER

      public static final ContractRule LENS_SWITCHER
      At most one lens switcher for the whole dashboard.
  • Method Details

    • values

      public static ContractRule[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ContractRule valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • selector

      public String selector()
      The CSS selector that must match according to cardinality().
      Returns:
      the CSS selector
    • cardinality

      public Cardinality cardinality()
      How many times selector() is allowed or required to match.
      Returns:
      the cardinality