public static Collection<String> names(Flags flags){
  final Collection<String> results=new ArrayList<String>();
  if (flags.contains(Flags.Flag.ANSWERED)) {
    results.add(ANSWERED_OUTPUT_CAPITALISED);
  }
  if (flags.contains(Flags.Flag.DELETED)) {
    results.add(DELETED_OUTPUT_CAPITALISED);
  }
  if (flags.contains(Flags.Flag.DRAFT)) {
    results.add(DRAFT_OUTPUT_CAPITALISED);
  }
  if (flags.contains(Flags.Flag.FLAGGED)) {
    results.add(FLAGGED_OUTPUT_CAPITALISED);
  }
  if (flags.contains(Flags.Flag.RECENT)) {
    results.add(RECENT_OUTPUT_CAPITALISED);
  }
  if (flags.contains(Flags.Flag.SEEN)) {
    results.add(SEEN_OUTPUT_CAPITALISED);
  }
  String[] userFlags=flags.getUserFlags();
  Collections.addAll(results,userFlags);
  if (flags.contains(Flags.Flag.USER)) {
    results.add(USER_OUTPUT_CAPITALISED);
  }
  return results;
}

public static Collection < String > names ( Flags flags ) { final Collection < String > results = new ArrayList < String > ( ) ; if ( flags . contains ( Flags . Flag . ANSWERED ) ) { results . add ( ANSWERED_OUTPUT_CAPITALISED ) ; } if ( flags . contains ( Flags . Flag . DELETED ) ) { results . add ( DELETED_OUTPUT_CAPITALISED ) ; } if ( flags . contains ( Flags . Flag . DRAFT ) ) { results . add ( DRAFT_OUTPUT_CAPITALISED ) ; } if ( flags . contains ( Flags . Flag . FLAGGED ) ) { results . add ( FLAGGED_OUTPUT_CAPITALISED ) ; } if ( flags . contains ( Flags . Flag . RECENT ) ) { results . add ( RECENT_OUTPUT_CAPITALISED ) ; } if ( flags . contains ( Flags . Flag . SEEN ) ) { results . add ( SEEN_OUTPUT_CAPITALISED ) ; } String [ ] userFlags = flags . getUserFlags ( ) ; Collections . addAll ( results , userFlags ) ; if ( flags . contains ( Flags . Flag . USER ) ) { results . add ( USER_OUTPUT_CAPITALISED ) ; } return results ; }
returns imap formatted string naming flags .
