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

me.chanjar.weixin.cp.bean.messagebuilder.BaseBuilder Maven / Gradle / Ivy

There is a newer version: 1.3.3
Show newest version
package me.chanjar.weixin.cp.bean.messagebuilder;

import me.chanjar.weixin.cp.bean.WxCpMessage;

public class BaseBuilder {
  protected String msgType;
  protected String agentId;
  protected String toUser;
  protected String toParty;
  protected String toTag;

  public T agentId(String agentId) {
    this.agentId = agentId;
    return (T) this;
  }

  public T toUser(String toUser) {
    this.toUser = toUser;
    return (T) this;
  }

  public T toParty(String toParty) {
    this.toParty = toParty;
    return (T) this;
  }

  public T toTag(String toTag) {
    this.toTag = toTag;
    return (T) this;
  }

  public WxCpMessage build() {
    WxCpMessage m = new WxCpMessage();
    m.setAgentId(this.agentId);
    m.setMsgType(this.msgType);
    m.setToUser(this.toUser);
    m.setToParty(this.toParty);
    m.setToTag(this.toTag);
    return m;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy