FileDocCategorySizeDatePackage
Param.javaAPI DocGlassfish v2 API4252Fri May 04 22:33:18 BST 2007com.sun.enterprise.admin.common

Param

public class Param extends Object implements Serializable
Encapsulates a name/value pair.

The name of a Param is required to be a string, but its value may be any Serializable object. Param does not alter value at any time. Thus Param is an immutable class.

author
Lloyd Chambers
version
1.0

Fields Summary
public static long
serialVersionUID
public String
mName
public Serializable
mValue
Constructors Summary
public Param(String name, Serializable value)
Constructs a new Param with name and value.

param
name non-null String specifying parameter name
param
value any Serializable (may be null)


			       				 		    		 	    	 
	      
	
		//Assert.assert( (name != null), "null name" );

		mName	= name;
		mValue	= value;
	
Methods Summary
public booleanequals(java.lang.Object other)
Defines the logical equality of Param instance with any other Object. Note that this method does not obey the general contract of the java.lang.Object.equls() method. An instance of Param is equal to other Object iff
  • it is also an instance of Param &&
  • it has the same name as that of this instance. It is clear that this method does not take into account the value of the Param.

    param
    other instance of object to be compared
    return
    boolean false if the objects are "equal" false otherwise

                boolean isSame = false;
                if (other instanceof Param)
                {
                    isSame = this.mName.equals(((Param)other).mName);
                }
                
                return isSame;
            
  • public inthashCode()
    Generates the hashcode for this param. Since equals() method takes only name into account, this method also takes into account only the name.

    return
    integer hashcode

                return (mName.hashCode ());
            
    public java.lang.StringtoString()
    Generates a string of the form: "name: value".

    		if ( mValue != null )
    		{
    			return( mName + ": " + mValue );
    		}
    		return( mName + ": <null>" );