1 15 package com.openedit.modules.email; 16 17 20 public class Recipient 21 { 22 protected String fieldEmailAddress; 23 protected String fieldFirstName; 24 protected String fieldLastName; 25 public String getEmailAddress() 26 { 27 return fieldEmailAddress; 28 } 29 30 public String getFirstName() 31 { 32 return fieldFirstName; 33 } 34 35 public String getLastName() 36 { 37 return fieldLastName; 38 } 39 40 public void setEmailAddress(String string) 41 { 42 fieldEmailAddress = string; 43 } 44 45 public void setFirstName(String string) 46 { 47 fieldFirstName = string; 48 } 49 50 public void setLastName(String string) 51 { 52 fieldLastName = string; 53 } 54 55 public String getFullName() 56 { 57 StringBuffer name = new StringBuffer (); 58 if ( getFirstName() != null) 59 { 60 name.append(getFirstName()); 61 } 62 if ( getLastName() != null) 63 { 64 if( name.length() > 0) 65 { 66 name.append(" "); 67 } 68 name.append(getLastName()); 69 } 70 if ( name.indexOf(",") > -1 || name.indexOf(".") > -1 ) 71 { 72 name.insert(0,"\""); 73 name.append("\""); 74 } 75 return name.toString(); 76 } 77 public String toString() 78 { 79 return getFullName() + " <" + getEmailAddress() + ">"; 80 } 81 } 82 | Popular Tags |