Files
weixin-java-tools/src/main/java/me/chanjar/weixin/bean/custombuilder/BaseBuilder.java

21 lines
432 B
Java
Raw Normal View History

package me.chanjar.weixin.bean.custombuilder;
2014-08-28 11:30:25 +08:00
import me.chanjar.weixin.bean.WxCustomMessage;
2014-08-28 11:30:25 +08:00
public class BaseBuilder<T> {
protected String msgtype;
2014-08-28 15:06:39 +08:00
protected String toUser;
2014-08-28 11:30:25 +08:00
2014-08-28 15:06:39 +08:00
public T toUser(String toUser) {
this.toUser = toUser;
2014-08-28 11:30:25 +08:00
return (T) this;
}
public WxCustomMessage build() {
WxCustomMessage m = new WxCustomMessage();
m.setMsgtype(this.msgtype);
2014-08-28 15:06:39 +08:00
m.setTouser(this.toUser);
2014-08-28 11:30:25 +08:00
return m;
}
}