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

me.chanjar.weixin.mp.builder.kefu.WxMsgMenuBuilder Maven / Gradle / Ivy

There is a newer version: 4.6.7.B
Show newest version
package me.chanjar.weixin.mp.builder.kefu;

import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;

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

/**
 * 菜单消息builder
 * 
 * 用法:
 * WxMpKefuMessage m = WxMpKefuMessage.MSGMENU().addMenus(lists).headContent(headContent).tailContent(tailContent).toUser(...).build();
 * 
* * @author billytomato */ public final class WxMsgMenuBuilder extends BaseBuilder { private List msgMenus = new ArrayList<>(); private String headContent; private String tailContent; public WxMsgMenuBuilder() { this.msgType = WxConsts.KefuMsgType.MSGMENU; } public WxMsgMenuBuilder addMenus(WxMpKefuMessage.MsgMenu... msgMenus) { Collections.addAll(this.msgMenus, msgMenus); return this; } public WxMsgMenuBuilder msgMenus(List msgMenus) { this.msgMenus = msgMenus; return this; } public WxMsgMenuBuilder headContent(String headContent) { this.headContent = headContent; return this; } public WxMsgMenuBuilder tailContent(String tailContent) { this.tailContent = tailContent; return this; } @Override public WxMpKefuMessage build() { WxMpKefuMessage m = super.build(); m.setHeadContent(this.headContent); m.setTailContent(this.tailContent); m.setMsgMenus(this.msgMenus); return m; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy