Package io.github.pimak.ntfy.core
Enum Class AlertLevel
- All Implemented Interfaces:
Serializable,Comparable<AlertLevel>,Constable
The severity of an
AlertEvent, as far as the alerting engine is concerned — the value
AlertEngine routes on.
Framework-neutral by construction: adapters map their own level type onto one of these two
constants (Logback/Log4j2 WARN, JUL WARNING → WARN;
ERROR/FATAL/SEVERE and above → ERROR) so no logging framework's
level class leaks into core.
There are deliberately only two constants. Alerting is ERROR-only by default
and a WARN route is opt-in (warn-topic); there is intentionally no way to express "route
INFO" or "route DEBUG". That floor used to be a convention repeated in every adapter's gate — as
an enum with no sub-WARN constant it becomes a property of the type instead, so no adapter, and
no future one, can widen it by accident. Anything below WARN is dropped by the adapter before an
AlertEvent is ever built.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic AlertLevelReturns the enum constant of this class with the specified name.static AlertLevel[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
WARN
Warning-level. Alerted only when the operator configured awarn-topic; otherwise the adapters never submit such an event and the engine drops it if one arrives anyway. -
ERROR
Error-level and above (Log4j2FATAL, JULSEVERE, and any custom level above them). Always alerted — this is the engine's default and only mandatory route.
-
-
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
-