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

me.chanjar.weixin.mp.bean.custombuilder.MusicBuilder Maven / Gradle / Ivy

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

import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.mp.bean.WxMpCustomMessage;

/**
 * 音乐消息builder
 * 
 * 用法: WxMpCustomMessage m = WxMpCustomMessage.MUSIC()
 *                      .musicUrl(...)
 *                      .hqMusicUrl(...)
 *                      .title(...)
 *                      .thumbMediaId(..)
 *                      .description(..)
 *                      .toUser(...)
 *                      .build();
 * 
*/ public final class MusicBuilder extends BaseBuilder { private String title; private String description; private String thumbMediaId; private String musicUrl; private String hqMusicUrl; public MusicBuilder() { this.msgType = WxConsts.CUSTOM_MSG_MUSIC; } public MusicBuilder musicUrl(String musicurl) { this.musicUrl = musicurl; return this; } public MusicBuilder hqMusicUrl(String hqMusicurl) { this.hqMusicUrl = hqMusicurl; return this; } public MusicBuilder title(String title) { this.title = title; return this; } public MusicBuilder description(String description) { this.description = description; return this; } public MusicBuilder thumbMediaId(String thumb_media_id) { this.thumbMediaId = thumb_media_id; return this; } public WxMpCustomMessage build() { WxMpCustomMessage m = super.build(); m.setMusicUrl(this.musicUrl); m.setHqMusicUrl(this.hqMusicUrl); m.setTitle(title); m.setDescription(description); m.setThumbMediaId(thumbMediaId); return m; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy