1 package com.netease.nimlib.sdk.qchat.enums;
3 import androidx.annotation.NonNull;
5 import java.io.Serializable;
6 import java.util.LinkedHashMap;
8 import java.util.Objects;
131 private final int resource;
137 private final int type;
149 @SuppressWarnings(
"java:S3599")
152 put(
"MANAGE_SERVER", MANAGE_SERVER);
153 put(
"MANAGE_CHANNEL", MANAGE_CHANNEL);
154 put(
"MANAGE_ROLE", MANAGE_ROLE);
155 put(
"SEND_MSG", SEND_MSG);
156 put(
"ACCOUNT_INFO_SELF", ACCOUNT_INFO_SELF);
157 put(
"INVITE_SERVER", INVITE_SERVER);
158 put(
"KICK_SERVER", KICK_SERVER);
159 put(
"ACCOUNT_INFO_OTHER", ACCOUNT_INFO_OTHER);
160 put(
"RECALL_MSG", RECALL_MSG);
161 put(
"DELETE_MSG", DELETE_MSG);
162 put(
"REMIND_OTHER", REMIND_OTHER);
163 put(
"REMIND_EVERYONE", REMIND_EVERYONE);
164 put(
"MANAGE_BLACK_WHITE_LIST", MANAGE_BLACK_WHITE_LIST);
165 put(
"BAN_SERVER_MEMBER", BAN_SERVER_MEMBER);
166 put(
"RTC_CHANNEL_CONNECT", RTC_CHANNEL_CONNECT);
167 put(
"RTC_CHANNEL_DISCONNECT_OTHER", RTC_CHANNEL_DISCONNECT_OTHER);
168 put(
"RTC_CHANNEL_OPEN_MICROPHONE", RTC_CHANNEL_OPEN_MICROPHONE);
169 put(
"RTC_CHANNEL_OPEN_CAMERA", RTC_CHANNEL_OPEN_CAMERA);
170 put(
"RTC_CHANNEL_OPEN_CLOSE_OTHER_MICROPHONE", RTC_CHANNEL_OPEN_CLOSE_OTHER_MICROPHONE);
171 put(
"RTC_CHANNEL_OPEN_CLOSE_OTHER_CAMERA", RTC_CHANNEL_OPEN_CLOSE_OTHER_CAMERA);
172 put(
"RTC_CHANNEL_OPEN_CLOSE_EVERYONE_MICROPHONE", RTC_CHANNEL_OPEN_CLOSE_EVERYONE_MICROPHONE);
173 put(
"RTC_CHANNEL_OPEN_CLOSE_EVERYONE_CAMERA", RTC_CHANNEL_OPEN_CLOSE_EVERYONE_CAMERA);
174 put(
"RTC_CHANNEL_OPEN_SCREEN_SHARE", RTC_CHANNEL_OPEN_SCREEN_SHARE);
175 put(
"RTC_CHANNEL_CLOSE_OTHER_SCREEN_SHARE", RTC_CHANNEL_CLOSE_OTHER_SCREEN_SHARE);
176 put(
"SERVER_APPLY_HANDLE", SERVER_APPLY_HANDLE);
177 put(
"INVITE_APPLY_HISTORY_QUERY", INVITE_APPLY_HISTORY_QUERY);
178 put(
"MENTIONED_ROLE", MENTIONED_ROLE);
185 this(resource, type,
"", -1);
188 private QChatRoleResource(
int resource,
int type, @NonNull String name,
int ordinal) {
189 this.resource = resource;
251 return this.ordinal - o.
ordinal;
266 return StringUtil.isEmpty(name) ? String.valueOf(resource) :
name;
274 if (o == null || getClass() != o.getClass()) {
278 return resource == resource1.resource && type == resource1.type;
283 return Objects.hash(resource, type);
288 if (value == pt.value()) {
296 return ROLE_MAP.get(name);
303 result[index++] = pt;
static final QChatRoleResource REMIND_OTHER
@ 他人的权限,server和channel都有
static final QChatRoleResource RTC_CHANNEL_OPEN_CLOSE_OTHER_MICROPHONE
RTC频道:开启/关闭他人麦克风的权限
static final QChatRoleResource RTC_CHANNEL_CONNECT
RTC频道:连接的权限
static final QChatRoleResource RTC_CHANNEL_OPEN_CLOSE_OTHER_CAMERA
RTC频道:开启/关闭他人摄像头的权限
QChatRoleResource(int resource, int type)
int compareTo(QChatRoleResource o)
模拟枚举类型的对比方法
static final QChatRoleResource BAN_SERVER_MEMBER
封禁他人的权限,仅server有,允许成员永久封禁其他成员访问此服务器
static final QChatRoleResource DELETE_MSG
删除他人消息的权限,server和channel都有
static final QChatRoleResource RTC_CHANNEL_DISCONNECT_OTHER
RTC频道:断开他人连接的权限
static final QChatRoleResource SERVER_APPLY_HANDLE
服务器申请处理权限
static final QChatRoleResource RTC_CHANNEL_OPEN_CAMERA
RTC频道:开启摄像头的权限
static final QChatRoleResource RTC_CHANNEL_CLOSE_OTHER_SCREEN_SHARE
RTC频道:关闭他人屏幕共享的权限
static final QChatRoleResource INVITE_SERVER
邀请他人进入server的,仅server有
static final QChatRoleResource RTC_CHANNEL_OPEN_CLOSE_EVERYONE_CAMERA
RTC频道:开启/关闭全员摄像头的权限
static final QChatRoleResource MENTIONED_ROLE
@身份组的权限,server和channel都有
static final QChatRoleResource MANAGE_CHANNEL
管理频道,server和channel都有
static final QChatRoleResource ACCOUNT_INFO_SELF
修改自己在该server的服务器成员信息,仅server有
static QChatRoleResource getByValue(int value)
static final QChatRoleResource INVITE_APPLY_HISTORY_QUERY
申请邀请历史查看权限,有这个权限才可以查询server级别的申请/邀请记录
static final QChatRoleResource MANAGE_SERVER
管理服务器:修改服务器,仅server有
boolean isOnlyChannelPermission()
是否是仅Channel才拥有的权限
boolean isOnlyServerPermission()
是否是仅Server才拥有的权限
final int ordinal
模拟枚举类型的序号
static final QChatRoleResource SEND_MSG
发送消息,server和channel都有
final Class< QChatRoleResource > getDeclaringClass()
模拟枚举类型的对应方法
static final QChatRoleResource RTC_CHANNEL_OPEN_CLOSE_EVERYONE_MICROPHONE
RTC频道:开启/关闭全员麦克风的权限
static final QChatRoleResource RTC_CHANNEL_OPEN_MICROPHONE
RTC频道:开启麦克风的权限
static final QChatRoleResource RECALL_MSG
撤回他人消息的权限,server和channel都有
static final QChatRoleResource MANAGE_BLACK_WHITE_LIST
管理黑白名单的权限,server和channel都有
static final QChatRoleResource MANAGE_ROLE
管理身份组的权限,server和channel都有
static final QChatRoleResource REMIND_EVERYONE
@ everyone,server和channel都有
boolean isAllPermission()
是否是Server和Channel都拥有的权限
static QChatRoleResource getByName(String name)
static final QChatRoleResource RTC_CHANNEL_OPEN_SCREEN_SHARE
RTC频道:打开自己屏幕共享的权限
static QChatRoleResource valueOf(String name)
static final QChatRoleResource MUTE
禁言权限
static final QChatRoleResource ACCOUNT_INFO_OTHER
修改他人在该server的服务器成员信息,仅server有
final String name
模拟枚举类型的变量名
static final QChatRoleResource KICK_SERVER
踢除他人的权限,仅server有
static QChatRoleResource [] values()