org.jcoderz.commons.connector
Class UserPassword

java.lang.Object
  extended by org.jcoderz.commons.connector.UserPassword

public final class UserPassword
extends Object

Provides UserName and Password.


Field Summary
static UserPassword EMPTY_USER_PASSWORD
          A UserPassword instance with a null userName and null password.
 
Method Summary
 boolean equals(Object other)
          
static UserPassword fromUserPassword(String user, String password)
          Returns a new UserPassword instance wrapping the given user and password.
static UserPassword fromUserPassword(UserPassword up)
          Constructs a new UserPassword instance containing exactly the same user and password as the up instance provides.
 String getPassword()
           
 String getUserName()
           
 int hashCode()
          
static boolean isEmpty(UserPassword up)
          Returns true if the UserPassword instance up contains a null UserName and null Password.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_USER_PASSWORD

public static final UserPassword EMPTY_USER_PASSWORD
A UserPassword instance with a null userName and null password.

Method Detail

fromUserPassword

public static UserPassword fromUserPassword(UserPassword up)
Constructs a new UserPassword instance containing exactly the same user and password as the up instance provides.

Parameters:
up - The UserPassword instance to be cloned.
Returns:
a new UserPassword instance containing the same user and password as the up instance provides.

fromUserPassword

public static UserPassword fromUserPassword(String user,
                                            String password)
Returns a new UserPassword instance wrapping the given user and password.

Parameters:
user - UserName
password - Password
Returns:
a new UserPassword instance wrapping the given user and password.

getPassword

public String getPassword()
Returns:
Returns the Password.

getUserName

public String getUserName()
Returns:
Returns the User.

isEmpty

public static boolean isEmpty(UserPassword up)
Returns true if the UserPassword instance up contains a null UserName and null Password.

Parameters:
up - UserPassword to be checked.
Returns:
true if the UserPassword instance up contains a null UserName and null Password; otherwise false.

equals

public boolean equals(Object other)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object


Copyright 2007 The jCoderZ Project.