com.tmsps.ne4weixin.bean.menu.Menu Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ne4weixin Show documentation
Show all versions of ne4weixin Show documentation
Ne4WeiXin For Spring is good :)
package com.tmsps.ne4weixin.bean.menu;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
public class Menu {
/**
* 一级菜单最多三个
*/
@JSONField(name = "button")
private List menuButton = new ArrayList();
public Menu(List menuButton) {
super();
this.menuButton = menuButton;
}
public List getMenuButton() {
return menuButton;
}
public void setMenuButton(List menuButton) {
if (null == menuButton || menuButton.size() > 3) {
throw new IllegalArgumentException("一级菜单最多只有3个");
}
this.menuButton = menuButton;
}
public void addMenuButton(MenuButton mb) {
this.menuButton.add(mb);
if (this.menuButton.size() > 3) {
throw new IllegalArgumentException("一级菜单最多只有3个");
}
}
}