Class DrinkUser

java.lang.Object
  extended byDrinkUser
All Implemented Interfaces:
Serializable

public class DrinkUser
extends Object
implements Serializable

A class to store drink user information. This class is simply just a storage class with accessors and mutators, nothing more.

Author:
Sean M. Graham
See Also:
Serialized Form

Field Summary
private  boolean admin
          Whether or not the user is an administrator.
private  int balance
          The balance of credits the user has on their account.
private  String password
          The user's password.
private  String username
          The username of the user.
 
Constructor Summary
DrinkUser(String inUsername, String inPassword, int inBalance, boolean inAdmin)
          Construct the Drink user.
 
Method Summary
 boolean getAdmin()
          Returns the user's admin status.
 int getBalance()
          Returns the user's balance.
 String getPassword()
          Returns the user's password.
 String getUsername()
          Returns the user's username.
 int hashCode()
          Returns a hashcode of the username stored in this DrinkUser.
 void setAdmin(boolean inAdmin)
          Changes the user's admin status
 void setBalance(int inBalance)
          Changes the user's balance.
 void setPassword(String inPassword)
          Changes the user's password.
 void setUsername(String inUsername)
          Sets the username belonging to this DrinkUser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

username

private String username
The username of the user.


password

private String password
The user's password.


balance

private int balance
The balance of credits the user has on their account.


admin

private boolean admin
Whether or not the user is an administrator.

Constructor Detail

DrinkUser

public DrinkUser(String inUsername,
                 String inPassword,
                 int inBalance,
                 boolean inAdmin)
Construct the Drink user.

Parameters:
inUsername - The username of the user.
inPassword - The user's password.
inBalance - The number of credits the user has on their account.
inAdmin - The admin status of the user.
Method Detail

getUsername

public String getUsername()
Returns the user's username.

Returns:
The user's username.

getPassword

public String getPassword()
Returns the user's password.

Returns:
The user's password.

getBalance

public int getBalance()
Returns the user's balance.

Returns:
The user's balance.

getAdmin

public boolean getAdmin()
Returns the user's admin status.

Returns:
The user's admin status.

setUsername

public void setUsername(String inUsername)
Sets the username belonging to this DrinkUser.

Parameters:
inUsername - The user's new username.

setPassword

public void setPassword(String inPassword)
Changes the user's password.

Parameters:
inPassword - The user's new password

setBalance

public void setBalance(int inBalance)
Changes the user's balance.

Parameters:
inBalance - The user's new balance.

setAdmin

public void setAdmin(boolean inAdmin)
Changes the user's admin status

Parameters:
inAdmin - The users new admin status.

hashCode

public int hashCode()
Returns a hashcode of the username stored in this DrinkUser.

Returns:
The hashcode