1 package com.netease.nimlib.sdk.chatroom.model;
3 import android.os.Parcel;
4 import android.os.Parcelable;
9 import java.io.Serializable;
16 private String roomId;
17 private String account;
19 private int memberLevel;
23 private String avatar;
24 private Map<String, Object> extension;
28 private boolean inBlackList;
31 private long enterTime;
32 private long updateTime;
34 private long tempMuteDuration;
36 private String notifyTargetTags;
150 this.roomId = roomId;
158 this.account = account;
174 this.memberLevel = memberLevel;
190 this.avatar = avatar;
198 this.extension = extension;
206 this.isOnline = online;
214 this.enterTime = enterTime;
222 this.inBlackList = inBlackList;
230 this.isMuted = muted;
238 this.isValid = valid;
254 this.updateTime = updateTime;
271 isTempMuted = tempMuted;
279 return tempMuteDuration;
288 this.tempMuteDuration = tempMuteDuration;
309 return notifyTargetTags;
316 this.notifyTargetTags = notifyTargetTags;
324 roomId = in.readString();
325 account = in.readString();
327 memberLevel = in.readInt();
329 nick = in.readString();
330 avatar = in.readString();
331 setExtension(MsgHelper.getMapFromJsonString(in.readString()));
333 isOnline = in.readByte() == 0x01;
334 inBlackList = in.readByte() == 0x01;
335 isMuted = in.readByte() == 0x01;
336 isValid = in.readByte() == 0x01;
337 enterTime = in.readLong();
338 updateTime = in.readLong();
339 isTempMuted = in.readByte() == 0x01;
340 tempMuteDuration = in.readLong();
350 dest.writeString(roomId);
351 dest.writeString(account);
353 dest.writeInt(memberLevel);
355 dest.writeString(nick);
356 dest.writeString(avatar);
357 dest.writeString(MsgHelper.getJsonStringFromMap(
getExtension()));
359 dest.writeByte(isOnline ? (byte) 0x01 : 0x00);
360 dest.writeByte(inBlackList ? (byte) 0x01 : 0x00);
361 dest.writeByte(isMuted ? (byte) 0x01 : 0x00);
362 dest.writeByte(isValid ? (byte) 0x01 : 0x00);
363 dest.writeLong(enterTime);
364 dest.writeLong(updateTime);
365 dest.writeByte(isTempMuted ? (byte) 0x01 : 0x00);
366 dest.writeLong(tempMuteDuration);
369 public static final Creator<ChatRoomMember>
CREATOR =
new Creator<ChatRoomMember>() {
void setAccount(String account)
设置用户帐号
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,可以由用户进聊天室时提交。