Enum Class AlertSeverity

java.lang.Object
java.lang.Enum<AlertSeverity>
com.kingsrook.qqq.backend.core.alerts.AlertSeverity
All Implemented Interfaces:
Serializable, Comparable<AlertSeverity>, Constable

public enum AlertSeverity extends Enum<AlertSeverity>
How urgent an alert is. Ordered from least to most severe, so isAtLeast / compareTo can be used for "minimum severity" checks. An alert means "a person should do something". INFO is for worth-a-glance items that never page anyone; external channels ignore it by default.
  • Enum Constant Details

  • Method Details

    • values

      public static AlertSeverity[] 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 AlertSeverity 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
    • isAtLeast

      public boolean isAtLeast(AlertSeverity other)
      True when this severity is the same as, or more severe than, the other. A null other is treated as INFO (so everything is at least it).
    • fromLabel

      public static AlertSeverity fromLabel(String label, AlertSeverity fallback)
      Leniently map a severity label from another system (Prometheus, a producer's own enum, etc) to an AlertSeverity. Case-insensitive; accepts common synonyms ("warn", "err", "fatal", "page", "info"/"informational"). Returns the fallback for null, blank or unknown values.