@Test public void test() throws Exception { QuotaRootResponse response = new QuotaRootResponse("INBOX", "root"); ByteImapResponseWriter byteImapResponseWriter = new ByteImapResponseWriter(); ImapResponseComposer composer = new ImapResponseComposerImpl(byteImapResponseWriter, 1024); QuotaRootResponseEncoder encoder = new QuotaRootResponseEncoder(); encoder.encode(response, composer); String responseString = byteImapResponseWriter.getString(); assertThat(responseString).isEqualTo("* QUOTAROOT \"INBOX\" root\r\n"); }
@Override public void encode(QuotaRootResponse quotaRootResponse, ImapResponseComposer composer) throws IOException { String quotaRoot = quotaRootResponse.getQuotaRoot(); String mailbox = quotaRootResponse.getMailboxName(); composer.untagged(); composer.message(ImapConstants.QUOTAROOT_RESPONSE_NAME); composer.mailbox(mailbox == null ? "" : mailbox); composer.message(quotaRoot == null ? "" : quotaRoot); composer.end(); }
QuotaRootResponseEncoder implements ImapResponseEncoder<QuotaRootResponse> { @Override public void encode(QuotaRootResponse quotaRootResponse, ImapResponseComposer composer) throws IOException { String quotaRoot = quotaRootResponse.getQuotaRoot(); String mailbox = quotaRootResponse.getMailboxName(); composer.untagged(); composer.message(ImapConstants.QUOTAROOT_RESPONSE_NAME); composer.mailbox(mailbox == null ? "" : mailbox); composer.message(quotaRoot == null ? "" : quotaRoot); composer.end(); } }
QuotaRootResponseEncoder implements ImapResponseEncoder<QuotaRootResponse> { @Override public void encode(QuotaRootResponse quotaRootResponse, ImapResponseComposer composer) throws IOException { String quotaRoot = quotaRootResponse.getQuotaRoot(); String mailbox = quotaRootResponse.getMailboxName(); composer.untagged(); composer.message(ImapConstants.QUOTAROOT_RESPONSE_NAME); composer.mailbox(mailbox == null ? "" : mailbox); composer.message(quotaRoot == null ? "" : quotaRoot); composer.end(); }  }
QuotaRootResponseEncoder implements ImapResponseEncoder<QuotaRootResponse> { @Override public void encode(QuotaRootResponse quotaRootResponse, ImapResponseComposer composer) throws IOException { String quotaRoot = quotaRootResponse.getQuotaRoot(); String mailbox = quotaRootResponse.getMailboxName(); composer.untagged(); composer.message(ImapConstants.QUOTAROOT_RESPONSE_NAME); composer.mailbox(mailbox == null ? "" : mailbox); composer.message(quotaRoot == null ? "" : quotaRoot); composer.end(); }  @Override Class<QuotaRootResponse> acceptableMessages(); @Override void encode(QuotaRootResponse quotaRootResponse, ImapResponseComposer composer); }
QuotaRootResponseEncoder implements ImapResponseEncoder<QuotaRootResponse> { @Override public void encode(QuotaRootResponse quotaRootResponse, ImapResponseComposer composer) throws IOException { String quotaRoot = quotaRootResponse.getQuotaRoot(); String mailbox = quotaRootResponse.getMailboxName(); composer.untagged(); composer.message(ImapConstants.QUOTAROOT_RESPONSE_NAME); composer.mailbox(mailbox == null ? "" : mailbox); composer.message(quotaRoot == null ? "" : quotaRoot); composer.end(); }  @Override Class<QuotaRootResponse> acceptableMessages(); @Override void encode(QuotaRootResponse quotaRootResponse, ImapResponseComposer composer);  }