93 lines
2.2 KiB
Java
Raw Normal View History

/* Copyright 2004, 2005, 2006 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
*/
2004-11-20 05:25:13 +00:00
public class Contact implements Serializable {
//~ Instance fields ================================================================================================
2004-03-16 23:57:17 +00:00
private Long id;
2004-03-16 23:57:17 +00:00
private String email;
private String name;
//~ Constructors ===================================================================================================
2004-03-16 23:57:17 +00:00
public Contact(String name, String email) {
2004-03-16 23:57:17 +00:00
this.name = name;
this.email = email;
}
public Contact() {}
2004-03-16 23:57:17 +00:00
//~ Methods ========================================================================================================
2004-03-16 23:57:17 +00:00
/**
* @return Returns the email.
*/
public String getEmail() {
return email;
}
/**
* @return Returns the id.
*/
public Long getId() {
2004-03-16 23:57:17 +00:00
return id;
}
/**
* @return Returns the name.
2004-03-16 23:57:17 +00:00
*/
public String getName() {
return name;
2004-03-16 23:57:17 +00:00
}
/**
* @param email The email to set.
2004-03-16 23:57:17 +00:00
*/
public void setEmail(String email) {
this.email = email;
}
public void setId(Long id) {
this.id = id;
}
/**
* @param name The name to set.
*/
public void setName(String name) {
this.name = name;
2004-03-16 23:57:17 +00:00
}
public String toString() {
StringBuilder sb = new StringBuilder();
2004-03-16 23:57:17 +00:00
sb.append(super.toString() + ": ");
sb.append("Id: " + this.getId() + "; ");
sb.append("Name: " + this.getName() + "; ");
sb.append("Email: " + this.getEmail());
2004-03-16 23:57:17 +00:00
return sb.toString();
}
}