net.sourceforge.sqlunit.beans
Class Severity

java.lang.Object
  extended by net.sourceforge.sqlunit.beans.Severity

public class Severity
extends java.lang.Object

The Severity bean models severity levels in SQLUnit.

Version:
$Revision: 1.1 $
Author:
Ivan Ivanov

Field Summary
static int ALL_INT
           
static Severity DEBUG
           
static int DEBUG_INT
           
static java.lang.String DEBUG_STR
           
static Severity ERROR
           
static int ERROR_INT
           
static java.lang.String ERROR_STR
           
static Severity FATAL
           
static int FATAL_INT
           
static java.lang.String FATAL_STR
           
static Severity INFO
           
static int INFO_INT
           
static java.lang.String INFO_STR
           
protected  int level
           
protected  java.lang.String levelName
           
static int OFF_INT
           
static Severity WARN
           
static int WARN_INT
           
static java.lang.String WARN_STR
           
 
Constructor Summary
protected Severity(int level, java.lang.String levelName)
          Create a new Severity object with the desired level id and name.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true if the object passed in is equal to this object.
 boolean isGreaterOrEquals(Severity s)
          Returns true if the specified severity is greater than or equal to this severity value.
static Severity toSeverity(java.lang.String levelName)
          Create a Severity object from its level name.
static Severity toSeverity(java.lang.String levelName, Severity defaultS)
          Create a Severity object from its level name.
 java.lang.String toString()
          Returns the String representation of this severity object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

level

protected int level

levelName

protected java.lang.String levelName

OFF_INT

public static final int OFF_INT
See Also:
Constant Field Values

FATAL_INT

public static final int FATAL_INT
See Also:
Constant Field Values

ERROR_INT

public static final int ERROR_INT
See Also:
Constant Field Values

WARN_INT

public static final int WARN_INT
See Also:
Constant Field Values

INFO_INT

public static final int INFO_INT
See Also:
Constant Field Values

DEBUG_INT

public static final int DEBUG_INT
See Also:
Constant Field Values

ALL_INT

public static final int ALL_INT
See Also:
Constant Field Values

FATAL_STR

public static final java.lang.String FATAL_STR
See Also:
Constant Field Values

ERROR_STR

public static final java.lang.String ERROR_STR
See Also:
Constant Field Values

WARN_STR

public static final java.lang.String WARN_STR
See Also:
Constant Field Values

INFO_STR

public static final java.lang.String INFO_STR
See Also:
Constant Field Values

DEBUG_STR

public static final java.lang.String DEBUG_STR
See Also:
Constant Field Values

DEBUG

public static final Severity DEBUG

INFO

public static final Severity INFO

WARN

public static final Severity WARN

ERROR

public static final Severity ERROR

FATAL

public static final Severity FATAL
Constructor Detail

Severity

protected Severity(int level,
                   java.lang.String levelName)
Create a new Severity object with the desired level id and name.

Parameters:
level - the level id.
levelName - the level name.
Method Detail

equals

public boolean equals(java.lang.Object o)
Returns true if the object passed in is equal to this object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the Object to compare with.
Returns:
true or false.

isGreaterOrEquals

public boolean isGreaterOrEquals(Severity s)
Returns true if the specified severity is greater than or equal to this severity value.

Parameters:
s - the Severity to compare with.
Returns:
true or false.

toString

public java.lang.String toString()
Returns the String representation of this severity object.

Overrides:
toString in class java.lang.Object
Returns:
the String representation of this object.

toSeverity

public static Severity toSeverity(java.lang.String levelName)
Create a Severity object from its level name.

Parameters:
levelName - the level name.
Returns:
a Severity object.

toSeverity

public static Severity toSeverity(java.lang.String levelName,
                                  Severity defaultS)
Create a Severity object from its level name. If none of the level name matches, then use the default Severity.

Parameters:
levelName - the level name to use.
defaults - the default Severity object to use.
Returns:
a Severity object.