1 21 22 27 28 package javax.mail.search; 29 30 import javax.mail.Message ; 31 import javax.mail.Address ; 32 import javax.mail.internet.InternetAddress ; 33 34 44 45 public abstract class AddressStringTerm extends StringTerm { 46 47 private static final long serialVersionUID = 3086821234204980368L; 48 49 54 protected AddressStringTerm(String pattern) { 55 super(pattern, true); } 57 58 70 protected boolean match(Address a) { 71 if (a instanceof InternetAddress ) { 72 InternetAddress ia = (InternetAddress )a; 73 77 return super.match(ia.toUnicodeString()); 78 } else 79 return super.match(a.toString()); 80 } 81 82 85 public boolean equals(Object obj) { 86 if (!(obj instanceof AddressStringTerm )) 87 return false; 88 return super.equals(obj); 89 } 90 } 91 | Popular Tags |