1 21 22 27 28 package javax.mail.search; 29 30 import javax.mail.Message ; 31 32 39 public final class SubjectTerm extends StringTerm { 40 41 private static final long serialVersionUID = 7481568618055573432L; 42 43 48 public SubjectTerm(String pattern) { 49 super(pattern); 51 } 52 53 60 public boolean match(Message msg) { 61 String subj; 62 63 try { 64 subj = msg.getSubject(); 65 } catch (Exception e) { 66 return false; 67 } 68 69 if (subj == null) 70 return false; 71 72 return super.match(subj); 73 } 74 75 78 public boolean equals(Object obj) { 79 if (!(obj instanceof SubjectTerm )) 80 return false; 81 return super.equals(obj); 82 } 83 } 84 | Popular Tags |