Enum Class StatusTone
- All Implemented Interfaces:
Serializable,Comparable<StatusTone>,Constable
The one closed status-tone palette shared by every surface that paints a semantic status colour:
info / success / warning / error / neutral.
Exactly five values, and no synonyms. Server-side checks accept a wire() token from
WIRE_TOKENS and reject anything else; the client-side painters (the pill, the QuickStats tiles and the
dialog-bar badge) silently ignore an off-palette token and apply no tone class. The same five names therefore mean
the same five things in Java, in the emitted is-<tone> CSS class, and in the juneau-renders.js tone
map.
Badge.tone uses this same enum and serializes it as the enum name.
Example:
- Since:
- 10.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionFailed / over a hard limit; maps tois-error.Informational (neither good nor bad); maps tois-info.No semantic colour; inherits the surrounding text colour and emits no tone class.Healthy / completed; maps tois-success.Approaching a limit or needing attention; maps tois-warning. -
Field Summary
FieldsModifier and TypeFieldDescriptionThe five legal wire tokens, in declaration order. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturnstrue if the specified token is one of the five legal tones.static StatusToneReturns the enum constant of this class with the specified name.static StatusTone[]values()Returns an array containing the constants of this enum class, in the order they are declared.wire()Returns the lowercase wire token for this tone.
-
Enum Constant Details
-
INFO
Informational (neither good nor bad); maps tois-info. -
SUCCESS
Healthy / completed; maps tois-success. -
WARNING
Approaching a limit or needing attention; maps tois-warning. -
ERROR
Failed / over a hard limit; maps tois-error. -
NEUTRAL
No semantic colour; inherits the surrounding text colour and emits no tone class.
-
-
Field Details
-
WIRE_TOKENS
The five legal wire tokens, in declaration order.The single source of truth every server-side tone check reads, so no caller can hand-roll a fourth or sixth value.
-
-
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
-
wire
Returns the lowercase wire token for this tone.- Returns:
- The wire token (e.g.
"warning" ).
-
isValid
Returnstrue if the specified token is one of the five legal tones.- Parameters:
token- The candidate wire token. Can benull .- Returns:
true if the token is a legal tone;false fornull , blank, differently-cased, or off-palette values.
-