@Test public void testShouldEncodeFlagsResponse() throws Exception { FetchResponse message = new FetchResponse(MSN, flags, null, null, null, null, null, null, null, null); encoder.encode(message, composer); assertThat(writer.getString()).isEqualTo("* 100 FETCH (FLAGS (\\Deleted))\r\n"); }
@Override public void encode(FetchResponse fetchResponse, ImapResponseComposer composer) throws IOException { MessageSequenceNumber messageNumber = fetchResponse.getMessageNumber(); composer.untagged().message(messageNumber.asInt()).message(ImapConstants.FETCH_COMMAND.getName()).openParen(); encodeModSeq(composer, fetchResponse); encodeFlags(composer, fetchResponse); encodeInternalDate(composer, fetchResponse); encodeSize(composer, fetchResponse); encodeEnvelope(composer, fetchResponse); encodeBody(composer, fetchResponse.getBody()); encodeBodyStructure(composer, fetchResponse.getBodyStructure()); encodeUid(composer, fetchResponse); encodeBodyElements(composer, fetchResponse.getElements()); composer.closeParen().end(); }
FetchResponseEncoder implements ImapResponseEncoder<FetchResponse> { @Override public void encode(FetchResponse fetchResponse, ImapResponseComposer composer) throws IOException { MessageSequenceNumber messageNumber = fetchResponse.getMessageNumber(); composer.untagged().message(messageNumber.asInt()).message(ImapConstants.FETCH_COMMAND.getName()).openParen(); encodeModSeq(composer, fetchResponse); encodeFlags(composer, fetchResponse); encodeInternalDate(composer, fetchResponse); encodeSize(composer, fetchResponse); encodeEnvelope(composer, fetchResponse); encodeBody(composer, fetchResponse.getBody()); encodeBodyStructure(composer, fetchResponse.getBodyStructure()); encodeUid(composer, fetchResponse); encodeBodyElements(composer, fetchResponse.getElements()); composer.closeParen().end(); } }
FetchResponseEncoder implements ImapResponseEncoder<FetchResponse> { @Override public void encode(FetchResponse fetchResponse, ImapResponseComposer composer) throws IOException { MessageSequenceNumber messageNumber = fetchResponse.getMessageNumber(); composer.untagged().message(messageNumber.asInt()).message(ImapConstants.FETCH_COMMAND.getName()).openParen(); encodeModSeq(composer, fetchResponse); encodeFlags(composer, fetchResponse); encodeInternalDate(composer, fetchResponse); encodeSize(composer, fetchResponse); encodeEnvelope(composer, fetchResponse); encodeBody(composer, fetchResponse.getBody()); encodeBodyStructure(composer, fetchResponse.getBodyStructure()); encodeUid(composer, fetchResponse); encodeBodyElements(composer, fetchResponse.getElements()); composer.closeParen().end(); } FetchResponseEncoder(boolean neverAddBodyStructureExtensions); }
FetchResponseEncoder implements ImapResponseEncoder<FetchResponse> { @Override public void encode(FetchResponse fetchResponse, ImapResponseComposer composer) throws IOException { MessageSequenceNumber messageNumber = fetchResponse.getMessageNumber(); composer.untagged().message(messageNumber.asInt()).message(ImapConstants.FETCH_COMMAND.getName()).openParen(); encodeModSeq(composer, fetchResponse); encodeFlags(composer, fetchResponse); encodeInternalDate(composer, fetchResponse); encodeSize(composer, fetchResponse); encodeEnvelope(composer, fetchResponse); encodeBody(composer, fetchResponse.getBody()); encodeBodyStructure(composer, fetchResponse.getBodyStructure()); encodeUid(composer, fetchResponse); encodeBodyElements(composer, fetchResponse.getElements()); composer.closeParen().end(); } FetchResponseEncoder(boolean neverAddBodyStructureExtensions); @Override Class<FetchResponse> acceptableMessages(); @Override void encode(FetchResponse fetchResponse, ImapResponseComposer composer); }
FetchResponseEncoder implements ImapResponseEncoder<FetchResponse> { @Override public void encode(FetchResponse fetchResponse, ImapResponseComposer composer) throws IOException { MessageSequenceNumber messageNumber = fetchResponse.getMessageNumber(); composer.untagged().message(messageNumber.asInt()).message(ImapConstants.FETCH_COMMAND.getName()).openParen(); encodeModSeq(composer, fetchResponse); encodeFlags(composer, fetchResponse); encodeInternalDate(composer, fetchResponse); encodeSize(composer, fetchResponse); encodeEnvelope(composer, fetchResponse); encodeBody(composer, fetchResponse.getBody()); encodeBodyStructure(composer, fetchResponse.getBodyStructure()); encodeUid(composer, fetchResponse); encodeBodyElements(composer, fetchResponse.getElements()); composer.closeParen().end(); } FetchResponseEncoder(boolean neverAddBodyStructureExtensions); @Override Class<FetchResponse> acceptableMessages(); @Override void encode(FetchResponse fetchResponse, ImapResponseComposer composer); static final String ENVELOPE; }