Example usage for javax.mail Flags equals

List of usage examples for javax.mail Flags equals

Introduction

In this page you can find the example usage for javax.mail Flags equals.

Prototype

@Override
public boolean equals(Object obj) 

Source Link

Document

Check whether the two Flags objects are equal.

Usage

From source file:org.sourceforge.net.javamail4ews.store.EwsFolder.java

public synchronized Message[] search(SearchTerm paramSearchTerm) throws MessagingException {
    if (paramSearchTerm instanceof FlagTerm) {
        FlagTerm flagTerm = (FlagTerm) paramSearchTerm;
        Flags flags = flagTerm.getFlags();
        if (flags.equals(new Flags(Flags.Flag.SEEN))) {
            try {
                return getUnreadMessage(0);
            } catch (Exception e) {
                throw new MessagingException(e.getMessage(), e);
            }//from w w w . j ava  2  s .  c  o  m
        }
    }
    throw new MessagingException("Ews folder don't support search with search term " + paramSearchTerm);
}