CLRA 0.1.2

com.clra.web
Class MemberView

java.lang.Object
  |
  +--com.clra.web.MemberView
All Implemented Interfaces:
Comparable, INamed, Serializable

public class MemberView
extends Object
implements INamed, Comparable, Serializable

Read-only information about a member. This is a thin wrapper around MemberSnapshot. The class exists so that some logic can be pulled out of the memberlist.jsp screen.

Version:
$Id: MemberView.java,v 1.2 2002/02/18 18:06:33 rphall Exp $
Author:
Rick Hall
See Also:
Serialized Form

Constructor Summary
MemberView()
          Produces an invalid MemberView.
MemberView(Integer id, String accountName, String accountPassword, String clraStatus, MemberName memberName, String email, Map telephoneNumbers, Address address, Date clraYear, Date birth)
           
MemberView(MemberSnapshot snapshot)
           
 
Method Summary
 int compareTo(Object o)
          Defines a natural ordering for members by lastname, firstname, middlename and suffix.
 boolean equals(Object o)
          Two members are equal iff their id's are equal.
 String getAccountName()
           
 String getAccountPassword()
           
 Address getAddress()
          FIXME define separate accessors for Address components?
 Date getBirthDate()
           
 String getClraStatus()
           
 Date getClraYear()
           
 String getEmail()
           
 Integer getId()
           
 MemberName getMemberName()
          FIXME return String with First, Middle, Last, Suffix
 MemberNameFormat getMemberNameFormat()
          Returns the format used by getName()
 String getName()
          Returns a String presentation of a member's name, formatted according to getMemberNameFormat().
 Map getTelephoneNumbers()
          FIXME define separate accessors for day/evening/other number
 boolean hasEmail()
           
 int hashCode()
          Member objects are hashed by id's
 boolean hasKnownBirthDate()
           
 void setMemberNameFormat(MemberNameFormat memberNameFormat)
          Sets the format used by getName()
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemberView

public MemberView()
Produces an invalid MemberView. Used only during deserialization

MemberView

public MemberView(MemberSnapshot snapshot)

MemberView

public MemberView(Integer id,
                  String accountName,
                  String accountPassword,
                  String clraStatus,
                  MemberName memberName,
                  String email,
                  Map telephoneNumbers,
                  Address address,
                  Date clraYear,
                  Date birth)
           throws ValidationException
Method Detail

getMemberNameFormat

public MemberNameFormat getMemberNameFormat()
Returns the format used by getName()

setMemberNameFormat

public void setMemberNameFormat(MemberNameFormat memberNameFormat)
Sets the format used by getName()

getName

public String getName()
Returns a String presentation of a member's name, formatted according to getMemberNameFormat().
Specified by:
getName in interface INamed
Following copied from interface: com.clra.util.INamed
Returns:
a non-null, non-blank, trimmed value. much sense to declare an object as 'named').

getId

public Integer getId()

getAccountName

public String getAccountName()

getAccountPassword

public String getAccountPassword()

getClraStatus

public String getClraStatus()

getMemberName

public MemberName getMemberName()
FIXME return String with First, Middle, Last, Suffix

hasEmail

public boolean hasEmail()

getEmail

public String getEmail()

getTelephoneNumbers

public Map getTelephoneNumbers()
FIXME define separate accessors for day/evening/other number

getAddress

public Address getAddress()
FIXME define separate accessors for Address components?

getClraYear

public Date getClraYear()

hasKnownBirthDate

public boolean hasKnownBirthDate()

getBirthDate

public Date getBirthDate()

equals

public boolean equals(Object o)
Two members are equal iff their id's are equal.
Overrides:
equals in class Object

hashCode

public int hashCode()
Member objects are hashed by id's
Overrides:
hashCode in class Object

compareTo

public int compareTo(Object o)
              throws ClassCastException
Defines a natural ordering for members by lastname, firstname, middlename and suffix.

Note: this class has a natural ordering that is inconsistent with equals. Equality is defined by member id's, not by member names.

Specified by:
compareTo in interface Comparable
Parameters:
o - A member object.
Throws:
ClassCastException - if o is not a member object.

CLRA 0.1.2