NIMSDK-AOS  10.6.0
ChatRoomKickOutEvent.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.chatroom.model;
2 
3 import com.netease.nimlib.biz.constant.IChatRoomService;
4 
5 import java.util.Map;
6 
10 public class ChatRoomKickOutEvent {
11 
12  public enum ChatRoomKickOutReason {
16  UNKNOWN(-1),
17 
21  CHAT_ROOM_INVALID(IChatRoomService.KickReason.CHAT_ROOM_INVALID),
22 
26  KICK_OUT_BY_MANAGER(IChatRoomService.KickReason.KICK_BY_MANAGER),
27 
31  KICK_OUT_BY_CONFLICT_LOGIN(IChatRoomService.KickReason.KICK_BY_CONFLICT_LOGIN),
32 
36  ILLEGAL_STAT(IChatRoomService.KickReason.ILLEGAL_STAT),
37 
41  BE_BLACKLISTED(IChatRoomService.KickReason.BE_BLACKLISTED);
42 
43  private int value;
44 
45  ChatRoomKickOutReason(int value) {
46  this.value = value;
47  }
48 
49  public int getValue() {
50  return value;
51  }
52 
53  public static ChatRoomKickOutReason typeOfValue(int value) {
54  for (ChatRoomKickOutReason e : values()) {
55  if (e.getValue() == value) {
56  return e;
57  }
58  }
59  return UNKNOWN;
60  }
61  }
62 
63  private String roomId;
64  private ChatRoomKickOutReason reason;
65  private Map<String, Object> extension;
66 
67  public ChatRoomKickOutEvent(String roomId, int reason, Map<String, Object> extension) {
68  this.roomId = roomId;
69  this.reason = ChatRoomKickOutReason.typeOfValue(reason);
70  this.extension = extension;
71  }
72 
73  public String getRoomId() {
74  return roomId;
75  }
76 
78  return reason;
79  }
80 
81  public Map<String, Object> getExtension() {
82  return extension;
83  }
84 }
ChatRoomKickOutEvent(String roomId, int reason, Map< String, Object > extension)