// Path: wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/factory/builder/ImageReplyBuilder.java
// public class ImageReplyBuilder implements ReplyBuilder {
//     @Override
//     public Reply buildReply(List<ReplyDetail> replyDetails) {
//         ReplyDetail detail = replyDetails.get(0);
//         return new ImageReply(new MediaDetail(detail.getMediaId()));
//     }
// 
// }
// 
// Path: wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/factory/builder/MusicReplyBuilder.java
// public class MusicReplyBuilder implements ReplyBuilder {
//     @Override
//     public Reply buildReply(List<ReplyDetail> replyDetails) {
//         ReplyDetail detail = replyDetails.get(0);
// 
//         MusicDetail musicDetail = new MusicDetail(
//                 detail.getTitle(),
//                 detail.getDescription(),
//                 detail.getMediaUrl(),
//                 detail.getUrl(),
//                 detail.getThumbMediaId());
// 
//         return new MusicReply(musicDetail);
//     }
// }
// 
// Path: wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/factory/builder/NewsReplyBuilder.java
// public class NewsReplyBuilder implements ReplyBuilder {
//     @Override
//     public Reply buildReply(List<ReplyDetail> replyDetails) {
//         int size = replyDetails.size();
//         List<NewsDetail> articles = new ArrayList<NewsDetail>(size);
//         for (ReplyDetail replyDetailVo : replyDetails) {
//             articles.add(new NewsDetail(
//                     replyDetailVo.getTitle(),
//                     replyDetailVo.getDescription(),
//                     replyDetailVo.getMediaUrl(),
//                     replyDetailVo.getUrl()));
//         }
// 
//         return new NewsReply(size, articles);
//     }
// 
// }
// 
// Path: wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/factory/builder/ReplyBuilder.java
// public interface ReplyBuilder {
//     Reply buildReply(List<ReplyDetail> replyDetails);
// }
// 
// Path: wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/factory/builder/TextReplyBuilder.java
// public class TextReplyBuilder implements ReplyBuilder {
//     @Override
//     public Reply buildReply(List<ReplyDetail> replyDetails) {
//         String content = replyDetails.get(0).getDescription();
//         if (StringUtils.isEmpty(content)) {
//             return null;
//         }
// 
//         return new TextReply(content);
// 
//     }
// }
// 
// Path: wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/factory/builder/VideoReplyBuilder.java
// public class VideoReplyBuilder implements ReplyBuilder {
//     @Override
//     public Reply buildReply(List<ReplyDetail> replyDetails) {
//         ReplyDetail detail = replyDetails.get(0);
// 
//         VideoDetail videoDetail = new VideoDetail(detail.getMediaId());
//         videoDetail.setTitle(detail.getTitle());
//         videoDetail.setDescription(detail.getDescription());
// 
//         return new VideoReply(videoDetail);
//     }
// 
// }


import java.util.List;
import org.usc.wechat.mp.sdk.factory.builder.ImageReplyBuilder;
import org.usc.wechat.mp.sdk.factory.builder.MusicReplyBuilder;
import org.usc.wechat.mp.sdk.factory.builder.NewsReplyBuilder;
import org.usc.wechat.mp.sdk.factory.builder.ReplyBuilder;
import org.usc.wechat.mp.sdk.factory.builder.TextReplyBuilder;
import org.usc.wechat.mp.sdk.factory.builder.VideoReplyBuilder;
import org.usc.wechat.mp.sdk.factory.builder.VoiceReplyBuilder;
import org.usc.wechat.mp.sdk.vo.ReplyDetail;
import org.usc.wechat.mp.sdk.vo.message.reply.Reply;
package org.usc.wechat.mp.sdk.factory;



/**
 *
 * @author Shunli
 */
public enum ReplyEnumFactory {
    TEXT("text", new TextReplyBuilder()),
    NEWS("news", new NewsReplyBuilder()),
    MUSIC("music", new MusicReplyBuilder()),
    IMAGE("image", new ImageReplyBuilder()),
    VOICE("voice", new VoiceReplyBuilder()),
    VIDEO("video", new VideoReplyBuilder());

    private String replyType;
    private ReplyBuilder replyBuilder;

    private ReplyEnumFactory(String replyType, ReplyBuilder replyBuilder) {
        this.replyType = replyType;
// Path: wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/factory/builder/ImageReplyBuilder.java
// public class ImageReplyBuilder implements ReplyBuilder {
//     @Override
//     public Reply buildReply(List<ReplyDetail> replyDetails) {
//         ReplyDetail detail = replyDetails.get(0);
//         return new ImageReply(new MediaDetail(detail.getMediaId()));
//     }
// 
// }
// 
// Path: wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/factory/builder/MusicReplyBuilder.java
// public class MusicReplyBuilder implements ReplyBuilder {
//     @Override
//     public Reply buildReply(List<ReplyDetail> replyDetails) {
//         ReplyDetail detail = replyDetails.get(0);
// 
//         MusicDetail musicDetail = new MusicDetail(
//                 detail.getTitle(),
//                 detail.getDescription(),
//                 detail.getMediaUrl(),
//                 detail.getUrl(),
//                 detail.getThumbMediaId());
// 
//         return new MusicReply(musicDetail);
//     }
// }
// 
// Path: wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/factory/builder/NewsReplyBuilder.java
// public class NewsReplyBuilder implements ReplyBuilder {
//     @Override
//     public Reply buildReply(List<ReplyDetail> replyDetails) {
//         int size = replyDetails.size();
//         List<NewsDetail> articles = new ArrayList<NewsDetail>(size);
//         for (ReplyDetail replyDetailVo : replyDetails) {
//             articles.add(new NewsDetail(
//                     replyDetailVo.getTitle(),
//                     replyDetailVo.getDescription(),
//                     replyDetailVo.getMediaUrl(),
//                     replyDetailVo.getUrl()));
//         }
// 
//         return new NewsReply(size, articles);
//     }
// 
// }
// 
// Path: wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/factory/builder/ReplyBuilder.java
// public interface ReplyBuilder {
//     Reply buildReply(List<ReplyDetail> replyDetails);
// }
// 
// Path: wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/factory/builder/TextReplyBuilder.java
// public class TextReplyBuilder implements ReplyBuilder {
//     @Override
//     public Reply buildReply(List<ReplyDetail> replyDetails) {
//         String content = replyDetails.get(0).getDescription();
//         if (StringUtils.isEmpty(content)) {
//             return null;
//         }
// 
//         return new TextReply(content);
// 
//     }
// }
// 
// Path: wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/factory/builder/VideoReplyBuilder.java
// public class VideoReplyBuilder implements ReplyBuilder {
//     @Override
//     public Reply buildReply(List<ReplyDetail> replyDetails) {
//         ReplyDetail detail = replyDetails.get(0);
// 
//         VideoDetail videoDetail = new VideoDetail(detail.getMediaId());
//         videoDetail.setTitle(detail.getTitle());
//         videoDetail.setDescription(detail.getDescription());
// 
//         return new VideoReply(videoDetail);
//     }
// 
// }


// Path: wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/factory/ReplyEnumFactory.java
import java.util.List;
import org.usc.wechat.mp.sdk.factory.builder.ImageReplyBuilder;
import org.usc.wechat.mp.sdk.factory.builder.MusicReplyBuilder;
import org.usc.wechat.mp.sdk.factory.builder.NewsReplyBuilder;
import org.usc.wechat.mp.sdk.factory.builder.ReplyBuilder;
import org.usc.wechat.mp.sdk.factory.builder.TextReplyBuilder;
import org.usc.wechat.mp.sdk.factory.builder.VideoReplyBuilder;
import org.usc.wechat.mp.sdk.factory.builder.VoiceReplyBuilder;
import org.usc.wechat.mp.sdk.vo.ReplyDetail;
import org.usc.wechat.mp.sdk.vo.message.reply.Reply;

package org.usc.wechat.mp.sdk.factory;



/**
 *
 * @author Shunli
 */
public enum ReplyEnumFactory {
    TEXT("text", new TextReplyBuilder()),
    NEWS("news", new NewsReplyBuilder()),
    MUSIC("music", new MusicReplyBuilder()),
    IMAGE("image", new ImageReplyBuilder()),
    VOICE("voice", new VoiceReplyBuilder()),
    VIDEO("video", new VideoReplyBuilder());

    private String replyType;
    private ReplyBuilder replyBuilder;

    private ReplyEnumFactory(String replyType, ReplyBuilder replyBuilder) {
        this.replyType = replyType;
        this.replyBuilder = replyBuilder;