FileDocCategorySizeDatePackage
MonitoringLevel.javaAPI DocGlassfish v2 API5259Fri May 04 22:25:46 BST 2007com.sun.enterprise.admin.monitor.registry

MonitoringLevel

public class MonitoringLevel extends Object
Provides enumerated constants related to various levels at which monitoring could be set
author
Shreedhar Ganapathy
author
Kedar Mhaswade

Fields Summary
public static final MonitoringLevel
OFF
public static final MonitoringLevel
LOW
public static final MonitoringLevel
HIGH
private final String
name
Constructors Summary
private MonitoringLevel(String name)
Constructor

    
          
        
        this.name = name;
    
Methods Summary
public booleanequals(java.lang.Object obj)
Checks two MonitoringLevel objects for equality.

Checks that obj is a MonitoringLevel, and has the same name as this object.

param
obj the object we are testing for equality with this object.
return
true if obj is a MonitoringLevel, and has the same name as this MonitoringLevel object.

	if (obj == this)
	    return true;

	if (! (obj instanceof MonitoringLevel))
	    return false;

	MonitoringLevel that = (MonitoringLevel) obj;

	return (this.name.equals(that.name));
    
public inthashCode()
Returns the hash code value for this object.

The hash code returned is the hash code of the name of this MonitoringLevel object.

return
Hash code value for this object.

	return this.name.hashCode();
    
public static com.sun.enterprise.admin.monitor.registry.MonitoringLevelinstance(java.lang.String name)
Returns an instance of MonitoringLevel for the given String. The given String has to correspond to one of the public fields declared in this class.

param
name String representing the MonitoringLevel
return
MonitoringLevel corresponding to given parameter, or null if the parameter is null or does not correspond to any of the Monitoring Levels supported. For $Revision: 1.3 $ of this class, "off", "high" and "low" are supported strings. The comparison is done case insensitively.

        if (OFF.toString().equalsIgnoreCase(name))
            return ( OFF );
        else if (LOW.toString().equalsIgnoreCase(name))
            return ( LOW );
        else if (HIGH.toString().equalsIgnoreCase(name))
            return ( HIGH );
        return ( null );
    
public java.lang.StringtoString()

        return ( name );