Package com.helger.commons.error.level
Enum EErrorLevel
- java.lang.Object
-
- java.lang.Enum<EErrorLevel>
-
- com.helger.commons.error.level.EErrorLevel
-
- All Implemented Interfaces:
IErrorLevel,IHasID<String>,ISeverityComparable<IErrorLevel>,IErrorIndicator,ISuccessIndicator,Serializable,Comparable<EErrorLevel>
public enum EErrorLevel extends Enum<EErrorLevel> implements IErrorLevel
Represents a generic error level.- Author:
- Philip Helger
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ERRORError levelFATAL_ERRORFatal errorINFOInformation levelSUCCESSSuccessWARNWarning level.
-
Field Summary
Fields Modifier and Type Field Description static EErrorLevelHIGHESTHighest error level within this enumstatic EErrorLevelLOWESTLowest error level within this enum
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EErrorLevelgetFromIDCaseInsensitiveOrDefault(String sID, EErrorLevel eDefault)static EErrorLevelgetFromIDCaseInsensitiveOrNull(String sID)static EErrorLevelgetFromIDCaseInsensitiveOrThrow(String sID)static EErrorLevelgetFromIDOrDefault(String sID, EErrorLevel eDefault)static EErrorLevelgetFromIDOrNull(String sID)static EErrorLevelgetFromIDOrThrow(String sID)StringgetID()Get the unique ID of this object.intgetNumericLevel()static EErrorLevelvalueOf(String name)Returns the enum constant of this type with the specified name.static EErrorLevel[]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, toString, valueOf
-
Methods inherited from interface com.helger.commons.error.level.IErrorLevel
compareTo, isEQ, isError, isFailure, isGE, isGT, isHighest, isLE, isLT, isNE, isNoError, isSuccess
-
Methods inherited from interface com.helger.commons.state.ISuccessIndicator
and, or
-
-
-
-
Enum Constant Detail
-
SUCCESS
public static final EErrorLevel SUCCESS
Success
-
INFO
public static final EErrorLevel INFO
Information level
-
WARN
public static final EErrorLevel WARN
Warning level.
-
ERROR
public static final EErrorLevel ERROR
Error level
-
FATAL_ERROR
public static final EErrorLevel FATAL_ERROR
Fatal error
-
-
Field Detail
-
LOWEST
public static final EErrorLevel LOWEST
Lowest error level within this enum
-
HIGHEST
public static final EErrorLevel HIGHEST
Highest error level within this enum
-
-
Method Detail
-
values
public static EErrorLevel[] 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 (EErrorLevel c : EErrorLevel.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EErrorLevel 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
-
getID
@Nonnull @Nonempty public String getID()
Description copied from interface:IHasIDGet the unique ID of this object. If the type isStringthan the returned value must match an XML NMToken expression (so e.g. no ':' in the ID)!
-
getNumericLevel
@Nonnegative public int getNumericLevel()
- Specified by:
getNumericLevelin interfaceIErrorLevel- Returns:
- The numeric level of this error level. Must be ≥ 0. The higher the numeric level, the higher the priority of the error level. So e.g. ERROR has a higher/larger/greater numerical level than WARNING.
-
getFromIDOrNull
@Nullable public static EErrorLevel getFromIDOrNull(@Nullable String sID)
-
getFromIDOrThrow
@Nonnull public static EErrorLevel getFromIDOrThrow(@Nullable String sID)
-
getFromIDOrDefault
@Nullable public static EErrorLevel getFromIDOrDefault(@Nullable String sID, @Nullable EErrorLevel eDefault)
-
getFromIDCaseInsensitiveOrNull
@Nullable public static EErrorLevel getFromIDCaseInsensitiveOrNull(@Nullable String sID)
-
getFromIDCaseInsensitiveOrThrow
@Nonnull public static EErrorLevel getFromIDCaseInsensitiveOrThrow(@Nullable String sID)
-
getFromIDCaseInsensitiveOrDefault
@Nullable public static EErrorLevel getFromIDCaseInsensitiveOrDefault(@Nullable String sID, @Nullable EErrorLevel eDefault)
-
-