1 package com.netease.nimlib.sdk.msg.config;
5 import java.io.Serializable;
19 private final boolean pushEnabled;
24 private final boolean pushNickEnabled;
29 private final String pushContent;
34 private final String pushPayload;
39 private final boolean forcePush;
44 private final String forcePushContent;
49 private final List<String> forcePushAccountIds;
71 private NIMMessagePushConfig(
boolean pushEnabled,
boolean pushNickEnabled, String pushContent, String pushPayload,
boolean forcePush,
72 String forcePushContent, List<String> forcePushAccountIds) {
73 this.pushEnabled = pushEnabled;
74 this.pushNickEnabled = pushNickEnabled;
75 this.pushContent = pushContent;
76 this.pushPayload = pushPayload;
77 this.forcePush = forcePush;
78 this.forcePushContent = forcePushContent;
79 this.forcePushAccountIds = forcePushAccountIds;
97 return pushNickEnabled;
133 return forcePushContent;
142 return forcePushAccountIds;
152 if (NimLog.isDebugLog()) {
153 return "NIMMessagePushConfig{" +
"pushEnabled=" + pushEnabled +
", pushNickEnabled=" + pushNickEnabled +
", content='" + pushContent +
'\'' 154 +
", payload='" + pushPayload +
'\'' +
", forcePush=" + forcePush +
", forcePushContent='" + forcePushContent +
'\'' 155 +
", forcePushAccountIds=" + forcePushAccountIds +
'}';
158 return "NIMMessagePushConfig{" +
"pushEnabled=" + pushEnabled +
", pushNickEnabled=" + pushNickEnabled +
", content='" 159 + EncryptUtil.encryptBase64(pushContent) +
'\'' +
", payload='" + EncryptUtil.encryptBase64(pushPayload) +
'\'' +
", forcePush=" + forcePush
160 +
", forcePushContent='" +
"*******" +
'\'' +
", forcePushAccountIds=" + forcePushAccountIds +
'}';
173 public static final class NIMMessagePushConfigBuilder {
177 private String content;
178 private String payload;
179 private boolean forcePush;
180 private String forcePushContent;
181 private List<String> forcePushAccountIds;
183 private NIMMessagePushConfigBuilder() {
191 public static NIMMessagePushConfigBuilder builder() {
192 return new NIMMessagePushConfigBuilder();
202 public NIMMessagePushConfigBuilder withPushEnabled(
boolean pushEnabled) {
203 this.pushEnabled = pushEnabled;
214 public NIMMessagePushConfigBuilder withPushNickEnabled(
boolean pushNickEnabled) {
215 this.pushNickEnabled = pushNickEnabled;
226 public NIMMessagePushConfigBuilder withContent(String content) {
227 this.content = content;
238 public NIMMessagePushConfigBuilder withPayload(String payload) {
239 this.payload = payload;
250 public NIMMessagePushConfigBuilder withForcePush(
boolean forcePush) {
251 this.forcePush = forcePush;
262 public NIMMessagePushConfigBuilder withForcePushContent(String forcePushContent) {
263 this.forcePushContent = forcePushContent;
274 public NIMMessagePushConfigBuilder withForcePushAccountIds(List<String> forcePushAccountIds) {
275 this.forcePushAccountIds = forcePushAccountIds;
285 return new NIMMessagePushConfig(pushEnabled, pushNickEnabled, content, payload, forcePush, forcePushContent, forcePushAccountIds);
String getPushContent()
获取推送内容
static final boolean DEFAULT_PUSH_NICK_ENABLE
String toString()
重写toString方法
List< String > getForcePushAccountIds()
获取强制推送目标账号列表
boolean isForcePush()
获取是否强制推送
static final boolean DEFAULT_PUSH_ENABLE
boolean isPushEnabled()
获取是否启用推送
String getForcePushContent()
获取强制推送内容
String getPushPayload()
获取推送数据
boolean isPushNickEnabled()
获取是否推送发送者昵称