/** * Mule Constant Contact Connector * * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.modules.constantcontact; public class ListRequestBuilder { private StringBuilder request; public ListRequestBuilder() { request = new StringBuilder(300); request.append("<entry xmlns=\"http://www.w3.org/2005/Atom\">"). append(" <id>data:,</id>"). append(" <title />"). append(" <author />"). append(" <updated>2008-04-16</updated>"). append(" <content type=\"application/vnd.ctct+xml\">"). append(" <ContactList xmlns=\"http://ws.constantcontact.com/ns/1.0/\">"); } public String build() { request.append(" </ContactList>"). append(" </content>"). append("</entry>"); return request.toString(); } public ListRequestBuilder setOptInDefault(Boolean optInDefault) { if (optInDefault != null) { request.append("<OptInDefault>").append(optInDefault).append("</OptInDefault>"); } return this; } public ListRequestBuilder setName(String name) { if (name != null) { request.append("<Name>").append(name).append("</Name>"); } return this; } public ListRequestBuilder setSortOrder(Integer sortOrder) { if (sortOrder != null) { request.append("<SortOrder>").append(sortOrder).append("</SortOrder>"); } return this; } }