ca.bc.gov.webade.user
Class DefaultGovernmentUserInfo

java.lang.Object
  extended byca.bc.gov.webade.user.AbstractWebADEUserInfo
      extended byca.bc.gov.webade.user.DefaultGovernmentUserInfo
All Implemented Interfaces:
GovernmentUserInfo, java.io.Serializable, WebADEUserInfo

public class DefaultGovernmentUserInfo
extends AbstractWebADEUserInfo
implements GovernmentUserInfo, java.io.Serializable

Author:
jross
See Also:
Serialized Form

Field Summary
 
Fields inherited from class ca.bc.gov.webade.user.AbstractWebADEUserInfo
MAX_DATE
 
Fields inherited from interface ca.bc.gov.webade.user.GovernmentUserInfo
ACCOUNT_TYPE, CITY, EMPLOYEE_ID
 
Fields inherited from interface ca.bc.gov.webade.user.WebADEUserInfo
DISPLAY_NAME, EMAIL_ADDRESS, EXPIRY_DATE, FIRST_NAME, IS_VISIBLE, LAST_NAME, MIDDLE_INITIAL, PHONE_NUMBER, USER_CREDENTIALS
 
Constructor Summary
  DefaultGovernmentUserInfo()
          Default Constructor.
  DefaultGovernmentUserInfo(DefaultGovernmentUserInfo user)
          Copy constructor.
protected DefaultGovernmentUserInfo(UserCredentials credentials)
          Basic constructor.
 
Method Summary
 java.lang.Object clone()
          Clones the WebADEUserInfo object.
 java.lang.String getAccountType()
           
 java.lang.String[] getAttributeNames()
          Returns the set of attribute names for user attributes supported by this object instance.
 java.lang.Object getAttributeValue(java.lang.String attributeName)
          Returns the value for the attribute with the given name.
 java.lang.String getCity()
           
 java.lang.String getEmployeeId()
           
 boolean hasAttribute(java.lang.String attributeName)
          Returns whether this object instance supports the attribute with the given name.
 boolean isEmployee()
           
 void setAccountType(java.lang.String accountType)
          Sets this user's accountType attribute to the given value.
 void setCity(java.lang.String city)
          Sets this user's city attribute to the given value.
 void setEmployeeId(java.lang.String employeeId)
          Sets this user's employeeId attribute to the given value.
 java.lang.String toString()
           
 
Methods inherited from class ca.bc.gov.webade.user.AbstractWebADEUserInfo
equals, getDisplayName, getEmailAddress, getExpiryDate, getFirstName, getLastName, getMiddleInitial, getPhoneNumber, getUserCredentials, hashCode, isReadOnly, isVisible, setDisplayName, setEmailAddress, setExpiryDate, setFirstName, setLastName, setMiddleInitial, setPhoneNumber, setReadOnly, setUserCredentials, setVisible
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ca.bc.gov.webade.user.WebADEUserInfo
getDisplayName, getEmailAddress, getExpiryDate, getFirstName, getLastName, getMiddleInitial, getPhoneNumber, getUserCredentials, isReadOnly, isVisible, setReadOnly
 

Constructor Detail

DefaultGovernmentUserInfo

public DefaultGovernmentUserInfo()
Default Constructor.


DefaultGovernmentUserInfo

public DefaultGovernmentUserInfo(DefaultGovernmentUserInfo user)
Copy constructor. Copies all user details from the given object to this instance.

Parameters:
user - The user object to copy.

DefaultGovernmentUserInfo

protected DefaultGovernmentUserInfo(UserCredentials credentials)
Basic constructor. Subclasses should pass in an instance of the appropriate credentials class.

Parameters:
credentials - The appropriate user credentials class.
Method Detail

getAccountType

public final java.lang.String getAccountType()
Specified by:
getAccountType in interface GovernmentUserInfo
Returns:
The user's BC Gov Account type.
See Also:
GovernmentUserInfo.getAccountType()

getEmployeeId

public final java.lang.String getEmployeeId()
Specified by:
getEmployeeId in interface GovernmentUserInfo
Returns:
The user's employee Id.
See Also:
GovernmentUserInfo.getEmployeeId()

isEmployee

public boolean isEmployee()
Specified by:
isEmployee in interface GovernmentUserInfo
Returns:
True if the user is a government employee.
See Also:
GovernmentUserInfo.isEmployee()

getCity

public java.lang.String getCity()
Specified by:
getCity in interface GovernmentUserInfo
Returns:
The user's city.
See Also:
GovernmentUserInfo.getCity()

getAttributeNames

public java.lang.String[] getAttributeNames()
Description copied from interface: WebADEUserInfo
Returns the set of attribute names for user attributes supported by this object instance.

Specified by:
getAttributeNames in interface WebADEUserInfo
Overrides:
getAttributeNames in class AbstractWebADEUserInfo
See Also:
AbstractWebADEUserInfo.getAttributeNames()

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String attributeName)
Description copied from interface: WebADEUserInfo
Returns the value for the attribute with the given name.

Specified by:
getAttributeValue in interface WebADEUserInfo
Overrides:
getAttributeValue in class AbstractWebADEUserInfo
See Also:
AbstractWebADEUserInfo.getAttributeValue(java.lang.String)

hasAttribute

public boolean hasAttribute(java.lang.String attributeName)
Description copied from interface: WebADEUserInfo
Returns whether this object instance supports the attribute with the given name.

Specified by:
hasAttribute in interface WebADEUserInfo
Overrides:
hasAttribute in class AbstractWebADEUserInfo
See Also:
AbstractWebADEUserInfo.hasAttribute(java.lang.String)

setAccountType

public final void setAccountType(java.lang.String accountType)
Sets this user's accountType attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
accountType - The accountType to set.

setEmployeeId

public final void setEmployeeId(java.lang.String employeeId)
Sets this user's employeeId attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
employeeId - The employeeId to set.

setCity

public void setCity(java.lang.String city)
Sets this user's city attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
city - The city to set.

clone

public java.lang.Object clone()
Clones the WebADEUserInfo object. The cloned object will have the isReadOnly() flag set to false, making it editable.

Specified by:
clone in interface WebADEUserInfo
Specified by:
clone in class AbstractWebADEUserInfo

toString

public java.lang.String toString()
Overrides:
toString in class AbstractWebADEUserInfo