1 21 22 27 28 package javax.mail.search; 29 30 import javax.mail.Message ; 31 32 43 public final class MessageIDTerm extends StringTerm { 44 45 private static final long serialVersionUID = -2121096296454691963L; 46 47 52 public MessageIDTerm(String msgid) { 53 super(msgid); 55 } 56 57 64 public boolean match(Message msg) { 65 String [] s; 66 67 try { 68 s = msg.getHeader("Message-ID"); 69 } catch (Exception e) { 70 return false; 71 } 72 73 if (s == null) 74 return false; 75 76 for (int i=0; i < s.length; i++) 77 if (super.match(s[i])) 78 return true; 79 return false; 80 } 81 82 85 public boolean equals(Object obj) { 86 if (!(obj instanceof MessageIDTerm )) 87 return false; 88 return super.equals(obj); 89 } 90 } 91 | Popular Tags |