All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.seejoke.wechat.entity.outbuilder.NewsBuilder Maven / Gradle / Ivy

package com.seejoke.wechat.entity.outbuilder;

import com.seejoke.wechat.entity.WxXmlOutNewsMessage;
import com.seejoke.wechat.entity.WxXmlOutNewsMessage.Item;

import java.util.ArrayList;
import java.util.List;

/**
 * 图文消息builder
 * 
 * @author diaodiaofly
 */
public final class NewsBuilder extends BaseBuilder {

	protected final List articles = new ArrayList();

	public NewsBuilder addArticle(Item item) {
		this.articles.add(item);
		return this;
	}

	@Override
    public WxXmlOutNewsMessage build() {
		WxXmlOutNewsMessage m = new WxXmlOutNewsMessage();
		for (Item item : articles) {
			m.addArticle(item);
		}
		setCommon(m);
		return m;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy