Enum SeverityLevel
- java.lang.Object
-
- java.lang.Enum<SeverityLevel>
-
- com.floragunn.signals.watch.severity.SeverityLevel
-
- All Implemented Interfaces:
Serializable,Comparable<SeverityLevel>
public enum SeverityLevel extends Enum<SeverityLevel> implements Comparable<SeverityLevel>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSeverityLevel.Set
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intcompare(SeverityLevel l1, SeverityLevel l2)static SeverityLevelgetById(String id)StringgetId()intgetLevel()StringgetName()booleanisGained(SeverityLevel oldLevel, SeverityLevel newLevel)booleanisHigherThan(SeverityLevel other)booleanisLost(SeverityLevel oldLevel, SeverityLevel newLevel)booleanisLowerThan(SeverityLevel other)Map<String,Object>toMap()StringtoString()static SeverityLevelvalueOf(String name)Returns the enum constant of this type with the specified name.static SeverityLevel[]values()Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Enum Constant Detail
-
NONE
public static final SeverityLevel NONE
-
INFO
public static final SeverityLevel INFO
-
WARNING
public static final SeverityLevel WARNING
-
ERROR
public static final SeverityLevel ERROR
-
CRITICAL
public static final SeverityLevel CRITICAL
-
-
Method Detail
-
values
public static SeverityLevel[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SeverityLevel c : SeverityLevel.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SeverityLevel valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
getLevel
public int getLevel()
-
getName
public String getName()
-
getId
public String getId()
-
toString
public String toString()
- Overrides:
toStringin classEnum<SeverityLevel>
-
isHigherThan
public boolean isHigherThan(SeverityLevel other)
-
isLowerThan
public boolean isLowerThan(SeverityLevel other)
-
isGained
public boolean isGained(SeverityLevel oldLevel, SeverityLevel newLevel)
-
isLost
public boolean isLost(SeverityLevel oldLevel, SeverityLevel newLevel)
-
compare
public static int compare(SeverityLevel l1, SeverityLevel l2)
-
getById
public static SeverityLevel getById(String id)
-
-