com.cc.framework.common
Class Severity

java.lang.Object
  extended bycom.cc.framework.common.Severity
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable, SimpleEnumType

public final class Severity
extends java.lang.Object
implements SimpleEnumType, java.io.Serializable, java.lang.Comparable

Defines severity types used by the common controls framework
Severity classes:

Since:
1.0
Version:
$Revision: 1.24 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private static Severity[] ALL
          The buffer with all kinds of severities
private  java.lang.String code
          Identifier
static Severity ERROR
          severity: ERROR
static Severity FATAL
          severity: FATAL
static Severity INFORMATION
          severity: INFORMATION
private  java.lang.String name
          display value / the nice name
static Severity NONE
          severity: NONE
static Severity QUESTION
          severity: QUESTION
private static long serialVersionUID
          Serial Version UID
private  int severity
          Category of the Error
static Severity WARNING
          severity: WARNING
 
Constructor Summary
private Severity(int severity, java.lang.String code, java.lang.String name)
          Constructor
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object obj)
          Compares this type to the specified object.
 int hashCode()
           
 boolean isError()
          Checks if the error class is of severity ERROR or FATAL
 boolean isInformation()
          Checks if the error class is of severity INFORMATION
 boolean isQuestion()
          Checks if the error class is of severity QUESTION
 boolean isWarning()
          Checks if the error class is of severity WARNING
static Severity max(Severity a, Severity b)
          Return the more significant Severity of two Objects
 java.lang.String niceName()
          Returns the nice name for this severity
static Severity parse(java.lang.String strSeverity)
          Creates for the argument an Object of type Severity
 int toInt()
          Returns the Severity as an Integer Value
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

NONE

public static final Severity NONE
severity: NONE


QUESTION

public static final Severity QUESTION
severity: QUESTION


INFORMATION

public static final Severity INFORMATION
severity: INFORMATION


WARNING

public static final Severity WARNING
severity: WARNING


ERROR

public static final Severity ERROR
severity: ERROR


FATAL

public static final Severity FATAL
severity: FATAL


severity

private int severity
Category of the Error


code

private java.lang.String code
Identifier


name

private java.lang.String name
display value / the nice name


ALL

private static final Severity[] ALL
The buffer with all kinds of severities

Constructor Detail

Severity

private Severity(int severity,
                 java.lang.String code,
                 java.lang.String name)
Constructor

Parameters:
severity - Severity
code - Identifier
name - Display value
Method Detail

toInt

public int toInt()
Returns the Severity as an Integer Value

Returns:
Integer Value

max

public static Severity max(Severity a,
                           Severity b)
Return the more significant Severity of two Objects

Parameters:
a - Severity Object A
b - Severity Object B
Returns:
Severity

equals

public boolean equals(java.lang.Object obj)
Compares this type to the specified object.

Parameters:
obj - The object to compare this Severity object against.
Returns:
true if the internal types are equal; false otherwise.

hashCode

public int hashCode()
See Also:
Object.hashCode()

isError

public boolean isError()
Checks if the error class is of severity ERROR or FATAL

Returns:
boolean True if the error class is of severity ERROR or FATAL, false otherwise

isWarning

public boolean isWarning()
Checks if the error class is of severity WARNING

Returns:
boolean True if the error class is of severity WARNING, false otherwise

isInformation

public boolean isInformation()
Checks if the error class is of severity INFORMATION

Returns:
boolean True if the error class is of severity INFORMATION, false otherwise

isQuestion

public boolean isQuestion()
Checks if the error class is of severity QUESTION

Returns:
boolean True if the error class is of severity QUESTION, false otherwise

niceName

public java.lang.String niceName()
Returns the nice name for this severity

Returns:
String The display name (nice name)

parse

public static Severity parse(java.lang.String strSeverity)
Creates for the argument an Object of type Severity

Parameters:
strSeverity - String to parse
Returns:
Severity

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)

toString

public java.lang.String toString()
See Also:
Object.toString()


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.