Enum Class ContractRule
- All Implemented Interfaces:
Serializable,Comparable<ContractRule>,Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionOne chart canvas per tracker section.The single root element wrapping the entire dashboard.At most one lens switcher for the whole dashboard.One metric card per stage, within each tracker section.Every metric card also carries the--percentcustom-property styling hook.At most one projection block per tracker section (absent when no projection is available).At most one stale-items table for the whole dashboard.One section per registered tracker. -
Method Summary
Modifier and TypeMethodDescriptionHow many timesselector()is allowed or required to match.selector()The CSS selector that must match according tocardinality().static ContractRuleReturns the enum constant of this class with the specified name.static ContractRule[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DASHBOARD_ROOT
The single root element wrapping the entire dashboard. -
TRACKER_SECTION
One section per registered tracker. -
METRIC_CARD
One metric card per stage, within each tracker section. -
METRIC_CARD_PERCENT_HOOK
Every metric card also carries the--percentcustom-property styling hook. -
PROJECTION_BLOCK
At most one projection block per tracker section (absent when no projection is available). -
CHART_CANVAS
One chart canvas per tracker section. -
STALE_TABLE
At most one stale-items table for the whole dashboard. -
LENS_SWITCHER
At most one lens switcher for the whole dashboard.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
selector
The CSS selector that must match according tocardinality().- Returns:
- the CSS selector
-
cardinality
How many timesselector()is allowed or required to match.- Returns:
- the cardinality
-