1 package com.netease.nimlib.sdk.msg.model;
7 import org.json.JSONObject;
9 import java.io.Serializable;
20 private final String fromAccount;
21 private final long replyType;
22 private final long time;
23 private final String ext;
24 private final boolean needPush;
25 private final boolean needBadge;
26 private final String pushTitle;
27 private final String pushContent;
28 private final Map<String, Object> pushPayload;
31 String fromAccount =
property.get(ITalkExtensionService.QuickCommentTag.fromAccount);
32 long replyType =
property.getLong(ITalkExtensionService.QuickCommentTag.replyType);
33 long time =
property.getLong(ITalkExtensionService.QuickCommentTag.time);
34 String ext =
property.get(ITalkExtensionService.QuickCommentTag.ext);
35 boolean needPush =
property.getInteger(ITalkExtensionService.QuickCommentTag.needPush) == 1;
36 boolean needBadge =
property.getInteger(ITalkExtensionService.QuickCommentTag.needBadge) == 1;
37 String pushTitle =
property.get(ITalkExtensionService.QuickCommentTag.pushTitle);
38 String pushContent =
property.get(ITalkExtensionService.QuickCommentTag.pushContent);
39 Map<String, Object> pushPayload = MsgHelper.getMapFromJsonString(property.get(ITalkExtensionService.QuickCommentTag.pushPayload));
40 return new QuickCommentOption(fromAccount, replyType, time, ext, needPush, needBadge, pushTitle, pushContent, pushPayload);
44 String fromAccount = obj.optString(String.valueOf(ITalkExtensionService.QuickCommentTag.fromAccount));
45 long replyType = obj.optLong(String.valueOf(ITalkExtensionService.QuickCommentTag.replyType));
46 long time = obj.optLong(String.valueOf(ITalkExtensionService.QuickCommentTag.time));
47 String ext = obj.optString(String.valueOf(ITalkExtensionService.QuickCommentTag.ext));
48 boolean needPush = obj.optInt(String.valueOf(ITalkExtensionService.QuickCommentTag.needPush)) == 1;
49 boolean needBadge = obj.optInt(String.valueOf(ITalkExtensionService.QuickCommentTag.needBadge)) == 1;
50 String pushTitle = obj.optString(String.valueOf(ITalkExtensionService.QuickCommentTag.pushTitle));
51 String pushContent = obj.optString(String.valueOf(ITalkExtensionService.QuickCommentTag.pushContent));
52 Map<String, Object> pushPayload = MsgHelper.getMapFromJsonString(obj.optString(String.valueOf(ITalkExtensionService.QuickCommentTag.pushPayload)));
53 return new QuickCommentOption(fromAccount, replyType, time, ext, needPush, needBadge, pushTitle, pushContent, pushPayload);
57 this(fromAccount, replyType, time, ext,
false,
false,
"",
"", null);
60 public QuickCommentOption(String fromAccount,
long replyType,
long time, String ext,
boolean needPush,
61 boolean needBadge, String pushTitle, String pushContent, Map<String, Object> pushPayload) {
62 this.fromAccount = fromAccount;
63 this.replyType = replyType;
66 this.needPush = needPush;
67 this.needBadge = needBadge;
68 this.pushTitle = pushTitle;
69 this.pushContent = pushContent;
70 this.pushPayload = pushPayload;