001: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
002: *
003: * Licensed under the Apache License, Version 2.0 (the "License");
004: * you may not use this file except in compliance with the License.
005: * You may obtain a copy of the License at
006: *
007: * http://www.apache.org/licenses/LICENSE-2.0
008: *
009: * Unless required by applicable law or agreed to in writing, software
010: * distributed under the License is distributed on an "AS IS" BASIS,
011: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012: * See the License for the specific language governing permissions and
013: * limitations under the License.
014: */
015:
016: package sample.contact;
017:
018: import java.io.Serializable;
019:
020: /**
021: * Represents a contact.
022: *
023: * @author Ben Alex
024: * @version $Id: Contact.java 1496 2006-05-23 13:38:33Z benalex $
025: */
026: public class Contact implements Serializable {
027: //~ Instance fields ================================================================================================
028:
029: private Long id;
030: private String email;
031: private String name;
032:
033: //~ Constructors ===================================================================================================
034:
035: public Contact(String name, String email) {
036: this .name = name;
037: this .email = email;
038: }
039:
040: public Contact() {
041: }
042:
043: //~ Methods ========================================================================================================
044:
045: /**
046: * DOCUMENT ME!
047: *
048: * @return Returns the email.
049: */
050: public String getEmail() {
051: return email;
052: }
053:
054: /**
055: * DOCUMENT ME!
056: *
057: * @return Returns the id.
058: */
059: public Long getId() {
060: return id;
061: }
062:
063: /**
064: * DOCUMENT ME!
065: *
066: * @return Returns the name.
067: */
068: public String getName() {
069: return name;
070: }
071:
072: /**
073: * DOCUMENT ME!
074: *
075: * @param email The email to set.
076: */
077: public void setEmail(String email) {
078: this .email = email;
079: }
080:
081: public void setId(Long id) {
082: this .id = id;
083: }
084:
085: /**
086: * DOCUMENT ME!
087: *
088: * @param name The name to set.
089: */
090: public void setName(String name) {
091: this .name = name;
092: }
093:
094: public String toString() {
095: StringBuffer sb = new StringBuffer();
096: sb.append(super .toString() + ": ");
097: sb.append("Id: " + this .getId() + "; ");
098: sb.append("Name: " + this .getName() + "; ");
099: sb.append("Email: " + this.getEmail());
100:
101: return sb.toString();
102: }
103: }
|