NIMSDK-AOS  9.19.0
AddFriendNotify.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.friend.model;
2 
3 import com.netease.nimlib.biz.constant.IFriendService;
4 
5 import java.io.Serializable;
6 
7 /**
8  * 添加好友的事件通知
9  */
10 public class AddFriendNotify implements Serializable {
11 
12  /**
13  * 收到的事件
14  */
15  public enum Event {
16  /**
17  * 对方直接加你为好友
18  */
19  RECV_ADD_FRIEND_DIRECT(IFriendService.VerifyType.ADD),
20 
21  /**
22  * 对方发起好友验证请求
23  */
24  RECV_ADD_FRIEND_VERIFY_REQUEST(IFriendService.VerifyType.ASK),
25 
26  /**
27  * 对方同意加你为好友
28  */
29  RECV_AGREE_ADD_FRIEND(IFriendService.VerifyType.AGREE),
30 
31  /**
32  * 对方拒绝加你为好友
33  */
34  RECV_REJECT_ADD_FRIEND(IFriendService.VerifyType.REJECT);
35 
36  private byte value;
37 
38  Event(byte value) {
39  this.value = value;
40  }
41 
42  public static Event eventOfValue(byte type) {
43  for (Event e : values()) {
44  if (e.getValue() == type) {
45  return e;
46  }
47  }
48  return null;
49  }
50 
51  public byte getValue() {
52  return value;
53  }
54  }
55 
56  private String account;
57 
58  private Event event;
59 
60  private String msg;
61 
62  private String serverExt;
63 
64  public AddFriendNotify(String account, Event event) {
65  this.account = account;
66  this.event = event;
67  }
68 
69  public AddFriendNotify(String account, Event event, String msg) {
70  this.account = account;
71  this.event = event;
72  this.msg = msg;
73  }
74 
75  public AddFriendNotify(String account, Event event, String msg, String serverExt) {
76  this.account = account;
77  this.event = event;
78  this.msg = msg;
79  this.serverExt = serverExt;
80  }
81 
82  public String getAccount() {
83  return account;
84  }
85 
86  public Event getEvent() {
87  return event;
88  }
89 
90  public String getMsg() {
91  return msg;
92  }
93 
94  public String getServerExt() {
95  return serverExt;
96  }
97 }
AddFriendNotify(String account, Event event, String msg)
AddFriendNotify(String account, Event event, String msg, String serverExt)