1 package com.netease.nimlib.sdk.v2.topic.params;
7 private static final int MAX_TOPIC_NAME_LENGTH = 128;
12 private final Integer type;
16 private final String topicName;
20 private final String serverExtension;
31 this.topicName = topicName;
32 this.serverExtension = serverExtension;
43 this.topicName = topicName;
44 this.serverExtension = serverExtension;
53 return type == null ? 0 : type;
80 return serverExtension;
89 if (type != null && type <= 0) {
90 return "type must be greater than 0";
92 if (topicName != null && topicName.length() > MAX_TOPIC_NAME_LENGTH) {
93 return "topicName length must be less than or equal to 128";
int getType()
返回 Topic 类型。
String getTopicName()
返回 Topic 名称。
String isValidWithErrorMsg()
返回参数非法原因。
V2NIMCreateTopicParams(int type, String topicName, String serverExtension)
构造创建 Topic 参数。
String getServerExtension()
返回服务端扩展字段。
V2NIMCreateTopicParams(String topicName, String serverExtension)
构造创建 Topic 参数。
boolean hasType()
Topic 类型是否已显式设置。