2005-11-04 04:15:57 +00:00
|
|
|
/* Copyright 2004, 2005 Acegi Technology Pty Limited
|
2004-03-16 23:57:17 +00:00
|
|
|
*
|
2004-03-23 04:44:48 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
2004-03-16 23:57:17 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
package sample.contact;
|
|
|
|
|
2004-11-20 05:25:13 +00:00
|
|
|
import java.io.Serializable;
|
|
|
|
|
|
|
|
|
2004-03-16 23:57:17 +00:00
|
|
|
/**
|
|
|
|
* Represents a contact.
|
|
|
|
*
|
|
|
|
* @author Ben Alex
|
|
|
|
* @version $Id$
|
|
|
|
*/
|
2004-11-20 05:25:13 +00:00
|
|
|
public class Contact implements Serializable {
|
2004-03-16 23:57:17 +00:00
|
|
|
//~ Instance fields ========================================================
|
|
|
|
|
2005-11-04 04:15:57 +00:00
|
|
|
private Long id;
|
2004-03-16 23:57:17 +00:00
|
|
|
private String email;
|
|
|
|
private String name;
|
|
|
|
|
|
|
|
//~ Constructors ===========================================================
|
|
|
|
|
2004-11-15 03:25:39 +00:00
|
|
|
public Contact(String name, String email) {
|
2004-03-16 23:57:17 +00:00
|
|
|
this.name = name;
|
|
|
|
this.email = email;
|
|
|
|
}
|
|
|
|
|
2004-11-15 03:25:39 +00:00
|
|
|
public Contact() {}
|
2004-03-16 23:57:17 +00:00
|
|
|
|
|
|
|
//~ Methods ================================================================
|
|
|
|
|
|
|
|
/**
|
|
|
|
* DOCUMENT ME!
|
|
|
|
*
|
|
|
|
* @param email The email to set.
|
|
|
|
*/
|
|
|
|
public void setEmail(String email) {
|
|
|
|
this.email = email;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* DOCUMENT ME!
|
|
|
|
*
|
|
|
|
* @return Returns the email.
|
|
|
|
*/
|
|
|
|
public String getEmail() {
|
|
|
|
return email;
|
|
|
|
}
|
|
|
|
|
2005-11-04 04:15:57 +00:00
|
|
|
public void setId(Long id) {
|
2004-11-15 03:25:39 +00:00
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
2004-03-16 23:57:17 +00:00
|
|
|
/**
|
|
|
|
* DOCUMENT ME!
|
|
|
|
*
|
|
|
|
* @return Returns the id.
|
|
|
|
*/
|
2005-11-04 04:15:57 +00:00
|
|
|
public Long getId() {
|
2004-03-16 23:57:17 +00:00
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* DOCUMENT ME!
|
|
|
|
*
|
|
|
|
* @param name The name to set.
|
|
|
|
*/
|
|
|
|
public void setName(String name) {
|
|
|
|
this.name = name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* DOCUMENT ME!
|
|
|
|
*
|
|
|
|
* @return Returns the name.
|
|
|
|
*/
|
|
|
|
public String getName() {
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
|
sb.append(super.toString() + ": ");
|
|
|
|
sb.append("Id: " + this.getId() + "; ");
|
|
|
|
sb.append("Name: " + this.getName() + "; ");
|
2004-11-15 03:25:39 +00:00
|
|
|
sb.append("Email: " + this.getEmail());
|
2004-03-16 23:57:17 +00:00
|
|
|
|
|
|
|
return sb.toString();
|
|
|
|
}
|
|
|
|
}
|