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

me.chanjar.weixin.cp.bean.templatecard.TemplateCardButtonSelectionOption Maven / Gradle / Ivy

There is a newer version: 4.6.7.B
Show newest version
package me.chanjar.weixin.cp.bean.templatecard;

import com.google.gson.JsonObject;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * @author chenjie03
 * @version 1.0
 * @since 2022/11/4 11:57
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TemplateCardButtonSelectionOption implements Serializable {
  private String id;
  private String text;


  /**
   * To json json object.
   *
   * @return the json object
   */
  public JsonObject toJson() {
    JsonObject btnObject = new JsonObject();

    if (StringUtils.isNotBlank(this.id)) {
      btnObject.addProperty("id", this.id);
    }
    if (StringUtils.isNotBlank(this.text)) {
      btnObject.addProperty("text", this.text);
    }
    return btnObject;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy