2014-10-14 16:23:00 +08:00
|
|
|
package me.chanjar.weixin.bean.custombuilder;
|
2014-08-28 11:30:25 +08:00
|
|
|
|
2014-10-14 16:23:00 +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;
|
|
|
|
}
|
|
|
|
}
|