public String encodeFlags(Flags flags){
  StringBuilder localFlagsString=new StringBuilder(":2,");
  if (flags.contains(Flags.Flag.DRAFT))   localFlagsString.append(FLAG_DRAFT);
  if (flags.contains(Flags.Flag.FLAGGED))   localFlagsString.append(FLAG_FLAGGED);
  if (flags.contains(Flags.Flag.ANSWERED))   localFlagsString.append(FLAG_ANSWERD);
  if (flags.contains(Flags.Flag.SEEN))   localFlagsString.append(FLAG_SEEN);
  if (flags.contains(Flags.Flag.DELETED))   localFlagsString.append(FLAG_DELETED);
  return localFlagsString.toString();
}

public String encodeFlags ( Flags flags ) { StringBuilder localFlagsString = new StringBuilder ( ":2," ) ; if ( flags . contains ( Flags . Flag . DRAFT ) ) localFlagsString . append ( FLAG_DRAFT ) ; if ( flags . contains ( Flags . Flag . FLAGGED ) ) localFlagsString . append ( FLAG_FLAGGED ) ; if ( flags . contains ( Flags . Flag . ANSWERED ) ) localFlagsString . append ( FLAG_ANSWERD ) ; if ( flags . contains ( Flags . Flag . SEEN ) ) localFlagsString . append ( FLAG_SEEN ) ; if ( flags . contains ( Flags . Flag . DELETED ) ) localFlagsString . append ( FLAG_DELETED ) ; return localFlagsString . toString ( ) ; }
creates a string that represents the provided flags
