1 package com.netease.nimlib.sdk.chatroom.model;
3 import android.os.Parcel;
4 import android.os.Parcelable;
7 import java.io.Serializable;
14 private String roomId;
15 private String account;
17 private int memberLevel;
21 private String avatar;
22 private Map<String, Object> extension;
23 private String extensionStr;
27 private boolean inBlackList;
30 private long enterTime;
31 private long updateTime;
33 private long tempMuteDuration;
35 private String notifyTargetTags;
149 this.roomId = roomId;
157 this.account = account;
173 this.memberLevel = memberLevel;
189 this.avatar = avatar;
197 this.extension = extension;
198 this.extensionStr = MsgHelper.getJsonStringFromMap(extension);
206 this.extensionStr = extensionStr;
207 this.extension = MsgHelper.getMapFromJsonString(extensionStr);
215 this.isOnline = online;
223 this.enterTime = enterTime;
231 this.inBlackList = inBlackList;
239 this.isMuted = muted;
247 this.isValid = valid;
263 this.updateTime = updateTime;
280 isTempMuted = tempMuted;
288 return tempMuteDuration;
297 this.tempMuteDuration = tempMuteDuration;
318 return notifyTargetTags;
325 this.notifyTargetTags = notifyTargetTags;
333 roomId = in.readString();
334 account = in.readString();
336 memberLevel = in.readInt();
338 nick = in.readString();
339 avatar = in.readString();
342 isOnline = in.readByte() == 0x01;
343 inBlackList = in.readByte() == 0x01;
344 isMuted = in.readByte() == 0x01;
345 isValid = in.readByte() == 0x01;
346 enterTime = in.readLong();
347 updateTime = in.readLong();
348 isTempMuted = in.readByte() == 0x01;
349 tempMuteDuration = in.readLong();
359 dest.writeString(roomId);
360 dest.writeString(account);
362 dest.writeInt(memberLevel);
364 dest.writeString(nick);
365 dest.writeString(avatar);
368 dest.writeByte(isOnline ? (byte) 0x01 : 0x00);
369 dest.writeByte(inBlackList ? (byte) 0x01 : 0x00);
370 dest.writeByte(isMuted ? (byte) 0x01 : 0x00);
371 dest.writeByte(isValid ? (byte) 0x01 : 0x00);
372 dest.writeLong(enterTime);
373 dest.writeLong(updateTime);
374 dest.writeByte(isTempMuted ? (byte) 0x01 : 0x00);
375 dest.writeLong(tempMuteDuration);
378 public static final Creator<ChatRoomMember>
CREATOR =
new Creator<ChatRoomMember>() {
void setAccount(String account)
设置用户帐号
void setExtensionStr(String extensionStr)
static final Creator< ChatRoomMember > CREATOR
MemberType getMemberType()
获取成员类型 成员类型:主要分为游客和非游客。 非游客又分成受限用户、普通用户、创建者、管理员; ...
void setMuted(boolean muted)
设置是否禁言
void setExtension(Map< String, Object > extension)
设置扩展字段
String getRoomId()
获取聊天室id
void setInBlackList(boolean inBlackList)
设置是否在黑名单中
void setNotifyTargetTags(String notifyTargetTags)
设置通知目标标签
String getAccount()
获取成员帐号
boolean isMuted()
判断用户是否被禁言
long getTempMuteDuration()
获取临时禁言解除时长,单位秒
void writeToParcel(Parcel dest, int flags)
void setNick(String nick)
设置成员昵称
void setTempMuteDuration(long tempMuteDuration)
设置临时禁言解除时长。 若需要设置临时禁言,请使用com.netease.nimlib.sdk.chatroom.ChatRoomService#mark...
void setTags(String tags)
设置用户标签
void setOnline(boolean online)
设置在线状态
long getEnterTime()
获取进入聊天室时间 对于离线成员该字段为空
void setRoomId(String roomId)
设置聊天室id
int getMemberLevel()
获取成员级别 大于等于0表示用户开发者可以自定义的级别
static MemberType typeOfValue(int value)
String getAvatar()
获取头像 可从NimUserInfo中取avatar,可以由用户进聊天室时提交。
void setValid(boolean valid)
设置是否有效
void setEnterTime(long enterTime)
设置进入聊天室时间
void setMemberLevel(int memberLevel)
设置成员等级
boolean isTempMuted()
判断用户是否被临时禁言
String getNick()
获取昵称 可从NimUserInfo中取,也可以由用户进聊天室时提交。
boolean isOnline()
判断用户是否处于在线状态 仅特殊成员才可能离线,对游客/匿名用户而言只能是在线。
void setAvatar(String avatar)
设置成员头像
ChatRoomMember(Parcel in)
********************************** 序列化 **********************************
String getNotifyTargetTags()
查询通知目标标签
void setTempMuted(boolean tempMuted)
设置是否临时禁言
boolean isInBlackList()
判断用户是否在黑名单中
long getUpdateTime()
获取固定成员的记录更新时间,用于固定成员列表的排列查询
void setMemberType(MemberType type)
设置成员类型
void setUpdateTime(long updateTime)
设置固定成员的更新时间
Map< String, Object > getExtension()
获取扩展字段 长度限制4k,可以由用户进聊天室时提交。