/** * A entry in a contact list or address book. **/ public class ContactEntry{ /** * The name of the contact **/ private String name; /** * The phone number of the contact **/ private String phone; /** * The email address of the contact **/ private String email; /** * Default constructor that sets each instance variable to null **/ public ContactEntry(){ name = null; phone = null; email = null; } /** * Constructor that sets each instance variable to the corresponding incoming parameter. * @param name name of the contact * @param phone the phone number of the contact * @param email the email address of the contact **/ public ContactEntry(String name, String phone, String email){ this.name = name; this.phone = phone; this.email = email; } /** * Modifier to set variable name to the incoming name * @param name new String for the name **/ public void setName(String name){ this.name = name; } /** * Modifier to set variable phone to the incoming phone number * @param phone new String for the phone variable **/ public void setPhone(String phone){ this.phone = phone; } /** * Modifier to set variable email to the incoming email address * @param email new String for the email variable **/ public void setEmail(String email){ this.email = email; } /** * Method to return the variable name * @return name **/ public String getName(){ return name; } /** * Method to return the variable phone * @return phone **/ public String getPhone(){ return phone; } /** * Method to return the variable email * @return email **/ public String getEmail(){ return email; } /** * Method to return a String representation of the contact's information * @return a String representation of the contact's information **/ public String toString(){ return "Name: " + name + "\nPhone: " + phone + "\nEmail: " + email; } }