Package com.helger.commons.error.level
Interface IErrorLevel
-
- All Superinterfaces:
IErrorIndicator,IHasID<String>,ISeverityComparable<IErrorLevel>,ISuccessIndicator
- All Known Implementing Classes:
EErrorLevel,ErrorLevel
@MustImplementEqualsAndHashcode public interface IErrorLevel extends IHasID<String>, ISuccessIndicator, IErrorIndicator, ISeverityComparable<IErrorLevel>
Interface representing a single error level.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intcompareTo(IErrorLevel aErrorLevel)static IErrorLevelgetMostSevere(IErrorLevel aLevel1, IErrorLevel aLevel2)intgetNumericLevel()default booleanisEQ(IErrorLevel aErrorLevel)Check if this object is of the same level (= equal important) than the passed object.default booleanisError()default booleanisFailure()default booleanisGE(IErrorLevel aErrorLevel)Check if this object is of equal or higher level (= equally or more important) than the passed object.default booleanisGT(IErrorLevel aErrorLevel)Check if this object is of higher level (= more important) than the passed object.default booleanisHighest()default booleanisLE(IErrorLevel aErrorLevel)Check if this object is of equal or lower level (= equally or less important) than the passed object.default booleanisLT(IErrorLevel aErrorLevel)Check if this object is of lower level (= less important) than the passed object.default booleanisNE(IErrorLevel aErrorLevel)Check if this object is of a different level (= different importance) than the passed object.default booleanisNoError()default booleanisSuccess()-
Methods inherited from interface com.helger.commons.state.ISuccessIndicator
and, or
-
-
-
-
Method Detail
-
getNumericLevel
@Nonnegative int getNumericLevel()
- 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.
-
isSuccess
default boolean isSuccess()
- Specified by:
isSuccessin interfaceISuccessIndicator- Returns:
trueon success andfalseon failure.
-
isFailure
default boolean isFailure()
- Specified by:
isFailurein interfaceISuccessIndicator- Returns:
trueon failure andfalseon success.
-
isError
default boolean isError()
- Specified by:
isErrorin interfaceIErrorIndicator- Returns:
trueif this level is at leastEErrorLevel.ERRORor worse.
-
isNoError
default boolean isNoError()
- Specified by:
isNoErrorin interfaceIErrorIndicator- Returns:
trueif this level is belowEErrorLevel.ERROR.
-
compareTo
default int compareTo(@Nonnull IErrorLevel aErrorLevel)
-
isEQ
default boolean isEQ(@Nonnull IErrorLevel aErrorLevel)
Description copied from interface:ISeverityComparableCheck if this object is of the same level (= equal important) than the passed object.- Specified by:
isEQin interfaceISeverityComparable<IErrorLevel>- Parameters:
aErrorLevel- The object to compare to.- Returns:
trueif this object is equally important than the passed object!
-
isNE
default boolean isNE(@Nonnull IErrorLevel aErrorLevel)
Description copied from interface:ISeverityComparableCheck if this object is of a different level (= different importance) than the passed object.- Specified by:
isNEin interfaceISeverityComparable<IErrorLevel>- Parameters:
aErrorLevel- The object to compare to.- Returns:
trueif this object is not equally important than the passed object!
-
isLT
default boolean isLT(@Nonnull IErrorLevel aErrorLevel)
Description copied from interface:ISeverityComparableCheck if this object is of lower level (= less important) than the passed object.- Specified by:
isLTin interfaceISeverityComparable<IErrorLevel>- Parameters:
aErrorLevel- The object to compare to.- Returns:
trueif this object is less important than the passed object!
-
isLE
default boolean isLE(@Nonnull IErrorLevel aErrorLevel)
Description copied from interface:ISeverityComparableCheck if this object is of equal or lower level (= equally or less important) than the passed object.- Specified by:
isLEin interfaceISeverityComparable<IErrorLevel>- Parameters:
aErrorLevel- The object to compare to.- Returns:
trueif this object is equally or less important than the passed object!
-
isGT
default boolean isGT(@Nonnull IErrorLevel aErrorLevel)
Description copied from interface:ISeverityComparableCheck if this object is of higher level (= more important) than the passed object.- Specified by:
isGTin interfaceISeverityComparable<IErrorLevel>- Parameters:
aErrorLevel- The object to compare to.- Returns:
trueif this object is more important than the passed object!
-
isGE
default boolean isGE(@Nonnull IErrorLevel aErrorLevel)
Description copied from interface:ISeverityComparableCheck if this object is of equal or higher level (= equally or more important) than the passed object.- Specified by:
isGEin interfaceISeverityComparable<IErrorLevel>- Parameters:
aErrorLevel- The object to compare to.- Returns:
trueif this object is equally or more important than the passed object!
-
isHighest
default boolean isHighest()
-
getMostSevere
@Nullable static IErrorLevel getMostSevere(@Nullable IErrorLevel aLevel1, @Nullable IErrorLevel aLevel2)
-
-