edu.wisc.ssec.mcidasv.servermanager
Class AddeAccount

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.servermanager.AddeAccount

public class AddeAccount
extends Object

Simplistic representation of ADDE accounting information. This is an immutable class.


Field Summary
private  String project
          Project number (currently not limited to a numeric value).
private  String username
          Username to hand off to the server.
 
Constructor Summary
AddeAccount(String user, String proj)
          Builds a new ADDE account object.
 
Method Summary
 boolean equals(Object obj)
          Determines whether or not a given object is equivalent to this ADDE account.
 String friendlyString()
          Returns a "human-friendly" representation of this accounting object.
 String getProject()
          Get the project number associated with this account.
 String getUsername()
          Get the username associated with this account.
 int hashCode()
          Computes the hashcode of this ADDE account using the hashcodes of username and project.
 String toString()
          Returns a string representation of this account.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

username

private final String username
Username to hand off to the server.


project

private final String project
Project number (currently not limited to a numeric value).

Constructor Detail

AddeAccount

public AddeAccount(String user,
                   String proj)
Builds a new ADDE account object.

Parameters:
user - Username to store. Cannot be null.
proj - Project number to store. Cannot be null.
Throws:
NullPointerException - if user or proj is null.
Method Detail

getUsername

public String getUsername()
Get the username associated with this account.

Returns:
username

getProject

public String getProject()
Get the project number associated with this account.

Returns:
project

equals

public boolean equals(Object obj)
Determines whether or not a given object is equivalent to this ADDE account. Currently the username and project number are case sensitive, though this is likely to change.

Overrides:
equals in class Object
Parameters:
obj - Object to test against.
Returns:
Whether or not obj is equivalent to this ADDE account.

hashCode

public int hashCode()
Computes the hashcode of this ADDE account using the hashcodes of username and project.

Overrides:
hashCode in class Object
Returns:
A hash code value for this object.

toString

public String toString()
Returns a string representation of this account. The formatting of this string is subject to change, but currently looks like:
[AddeAccount@HASHCODE: username=..., project=...]

Overrides:
toString in class Object
Returns:
String representation of this ADDE account.

friendlyString

public String friendlyString()
Returns a "human-friendly" representation of this accounting object. Currently looks like USER / PROJ.

Returns:
Friendly accounting detail String.