net.larsan.norna.service.log
Class Type

java.lang.Object
  |
  +--net.larsan.norna.service.log.Type

public class Type
extends java.lang.Object

Log record type. A type of a record toghether with it's severity can be used by the logging implementations to filter or prioritize the record.

A record type is not mandatory.

Version:
Alpha-0.2 / 2002-10-06 21:37
Author:
Lars J. Nilsson
See Also:
Level

Field Summary
static Type CONFIG
          Configuration record type.
static Type DEBUG
          Debug record type.
static Type ERROR
          Error record type.
static Type FAILURE
          Failure record type.
static Type INFO
          A message type record.
static Type TEST
          Test record type.
protected  int type
          Record type.
static Type UNKNOWN
          Unkown record type.
 
Constructor Summary
protected Type(int type)
          Create type
 
Method Summary
 boolean equals(java.lang.Object o)
          Equality check on record type
 int getType()
          Get record type.
 int hashCode()
          Hash code on type
static Type parse(java.lang.String type)
          Parse a string to a type.
 java.lang.String toString()
          Get type as string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INFO

public static final Type INFO
A message type record.


CONFIG

public static final Type CONFIG
Configuration record type.


DEBUG

public static final Type DEBUG
Debug record type.


ERROR

public static final Type ERROR
Error record type.


FAILURE

public static final Type FAILURE
Failure record type.


TEST

public static final Type TEST
Test record type.


UNKNOWN

public static final Type UNKNOWN
Unkown record type.


type

protected int type
Record type.

Constructor Detail

Type

protected Type(int type)
Create type

Method Detail

parse

public static Type parse(java.lang.String type)
Parse a string to a type. The string must be equal to the name of the identifiers in this class for the parsing to succeed.

Parameters:
type - String type to parse
Returns:
The levelm nuetral level if the parsing fails

getType

public int getType()
Get record type.

Returns:
The type of the type ... erhm..

toString

public java.lang.String toString()
Get type as string.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Equality check on record type

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Hash code on type

Overrides:
hashCode in class java.lang.Object