/**
* @see org.apache.james.mailbox.store.mail.model.MailboxMembership#createFlags()
*/
public final Flags createFlags() {
final Flags flags = new Flags();
if (isAnswered()) {
flags.add(Flags.Flag.ANSWERED);
}
if (isDeleted()) {
flags.add(Flags.Flag.DELETED);
}
if (isDraft()) {
flags.add(Flags.Flag.DRAFT);
}
if (isFlagged()) {
flags.add(Flags.Flag.FLAGGED);
}
if (isRecent()) {
flags.add(Flags.Flag.RECENT);
}
if (isSeen()) {
flags.add(Flags.Flag.SEEN);
}
String[] userFlags = createUserFlags();
if (userFlags != null && userFlags.length > 0) {
for (int i = 0; i < userFlags.length; i++) {
flags.add(userFlags[i]);
}
}
return flags;
}