use of javax.mail.search.SearchTerm in project jodd by oblac.
the class EmailFilter method messageId.
/**
* Defines filter for message id.
*/
public EmailFilter messageId(String messageId) {
SearchTerm msgIdTerm = new MessageIDTerm(messageId);
concat(msgIdTerm);
return this;
}
use of javax.mail.search.SearchTerm in project jodd by oblac.
the class EmailFilter method not.
/**
* Appends single filter as NOT.
*/
public EmailFilter not(EmailFilter emailFilter) {
SearchTerm searchTerm = new NotTerm(emailFilter.searchTerm);
concat(searchTerm);
return this;
}
use of javax.mail.search.SearchTerm in project jodd by oblac.
the class EmailFilter method flags.
/**
* Defines filter for many flags at once.
*/
public EmailFilter flags(Flags flags, boolean value) {
SearchTerm flagTerm = new FlagTerm(flags, value);
concat(flagTerm);
return this;
}
use of javax.mail.search.SearchTerm in project jodd by oblac.
the class EmailFilter method sentDate.
/**
* Defines filter for sent date.
*/
public EmailFilter sentDate(Operator operator, long milliseconds) {
SearchTerm term = new SentDateTerm(operator.value, new java.util.Date(milliseconds));
concat(term);
return this;
}
use of javax.mail.search.SearchTerm in project jodd by oblac.
the class EmailFilter method or.
/**
* Defines OR group of filters.
*/
public EmailFilter or(EmailFilter... emailFilters) {
SearchTerm[] searchTerms = new SearchTerm[emailFilters.length];
for (int i = 0; i < emailFilters.length; i++) {
searchTerms[i] = emailFilters[i].searchTerm;
}
concat(new OrTerm(searchTerms));
return this;
}
Aggregations