NIMSDK-AOS  10.5.0
SyncConfig.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.sync;
2 
3 import android.os.Parcel;
4 import android.os.Parcelable;
5 import java.io.Serializable;
6 
10 public class SyncConfig implements Serializable, Parcelable
11 {
12 
16  private boolean enableSyncTeamMember = true;
20  private boolean enableSyncTeamMemberUserInfo = true;
24  private boolean enableSyncSuperTeamMember = true;
28  private boolean enableSyncSuperTeamMemberUserInfo = true;
29 
30  public SyncConfig(Builder builder)
31  {
32  if(builder == null){
33  return;
34  }
35  this.enableSyncTeamMember = builder.enableSyncTeamMember;
36  this.enableSyncTeamMemberUserInfo = builder.enableSyncTeamMemberUserInfo;
37  this.enableSyncSuperTeamMember = builder.enableSyncSuperTeamMember;
38  this.enableSyncSuperTeamMemberUserInfo = builder.enableSyncSuperTeamMemberUserInfo;
39  }
40 
45  public boolean isEnableSyncTeamMember()
46  {
47  return enableSyncTeamMember;
48  }
49 
54  public boolean isEnableSyncSuperTeamMember()
55  {
56  return enableSyncSuperTeamMember;
57  }
58 
64  return enableSyncTeamMemberUserInfo;
65  }
66 
72  return enableSyncSuperTeamMemberUserInfo;
73  }
74 
75  public static class Builder
76  {
80  private boolean enableSyncTeamMember = true;
84  private boolean enableSyncTeamMemberUserInfo = true;
88  private boolean enableSyncSuperTeamMember = true;
92  private boolean enableSyncSuperTeamMemberUserInfo = true;
93 
99  public Builder setEnableSyncTeamMember(boolean enableSyncTeamMember)
100  {
101  this.enableSyncTeamMember = enableSyncTeamMember;
102  return this;
103  }
104 
110  public Builder setEnableSyncTeamMemberUserInfo(boolean enableSyncTeamMemberUserInfo) {
111  this.enableSyncTeamMemberUserInfo = enableSyncTeamMemberUserInfo;
112  return this;
113  }
114 
120  public Builder setEnableSyncSuperTeamMember(boolean enableSyncSuperTeamMember)
121  {
122  this.enableSyncSuperTeamMember = enableSyncSuperTeamMember;
123  return this;
124  }
125 
131  public Builder setEnableSyncSuperTeamMemberUserInfo(boolean enableSyncSuperTeamMemberUserInfo) {
132  this.enableSyncSuperTeamMemberUserInfo = enableSyncSuperTeamMemberUserInfo;
133  return this;
134  }
135 
136 
137  public SyncConfig build()
138  {
139  return new SyncConfig(this);
140  }
141  }
142 
143  @Override
144  public int describeContents() {
145  return 0;
146  }
147 
148  @Override
149  public void writeToParcel(Parcel dest, int flags) {
150  dest.writeByte(this.enableSyncTeamMember ? (byte) 1 : (byte) 0);
151  dest.writeByte(this.enableSyncTeamMemberUserInfo ? (byte) 1 : (byte) 0);
152  dest.writeByte(this.enableSyncSuperTeamMember ? (byte) 1 : (byte) 0);
153  dest.writeByte(this.enableSyncSuperTeamMemberUserInfo ? (byte) 1 : (byte) 0);
154  }
155 
156  public void readFromParcel(Parcel source) {
157  this.enableSyncTeamMember = source.readByte() != 0;
158  this.enableSyncTeamMemberUserInfo = source.readByte() != 0;
159  this.enableSyncSuperTeamMember = source.readByte() != 0;
160  this.enableSyncSuperTeamMemberUserInfo = source.readByte() != 0;
161  }
162 
163  protected SyncConfig(Parcel in) {
164  this.enableSyncTeamMember = in.readByte() != 0;
165  this.enableSyncTeamMemberUserInfo = in.readByte() != 0;
166  this.enableSyncSuperTeamMember = in.readByte() != 0;
167  this.enableSyncSuperTeamMemberUserInfo = in.readByte() != 0;
168  }
169 
170  public static final Creator<SyncConfig> CREATOR = new Creator<SyncConfig>() {
171  @Override
172  public SyncConfig createFromParcel(Parcel source) {
173  return new SyncConfig(source);
174  }
175 
176  @Override
177  public SyncConfig[] newArray(int size) {
178  return new SyncConfig[size];
179  }
180  };
181 }
boolean isEnableSyncSuperTeamMember()
是否同步超大群成员,默认为true
Definition: SyncConfig.java:54
boolean isEnableSyncTeamMember()
是否同步群成员,默认为true
Definition: SyncConfig.java:45
boolean isEnableSyncSuperTeamMemberUserInfo()
是否同步超大群成员用户信息,enableSyncSuperTeamMember为true时有效,默认为true
Definition: SyncConfig.java:71
static final Creator< SyncConfig > CREATOR
void writeToParcel(Parcel dest, int flags)
boolean isEnableSyncTeamMemberUserInfo()
是否同步群成员用户信息,enableSyncTeamMember为true时有效,默认为true
Definition: SyncConfig.java:63