NIMSDK-AOS  9.19.0
AVChatEngineConfig.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.avchat.model;
2 
3 
5 
6 /**
7  * 引擎初始化的一些自定义配置,使用{@link Builder} 去构造
8  */
9 public class AVChatEngineConfig {
10 
11  private AVChatEngineConfig() {
12 
13  }
14 
15  private int osType;
16 
17  private boolean lowEnergy;
18 
19  private AVChatServerAddresses serverAddresses;
20 
21 
22  public int getOsType() {
23  return osType;
24  }
25 
26  public boolean isLowEnergy() {
27  return lowEnergy;
28  }
29 
31  return serverAddresses;
32  }
33 
34 
35  /**
36  * 用于创建 AVChatEngineConfig {@link AVChatEngineConfig}
37  */
38  public static class Builder {
39 
40  private int osType = AVChatOSCategory.OS_DEFAULT;
41 
42  private boolean lowEnergy = false;
43 
44  private AVChatServerAddresses serverAddresses;
45 
46  public Builder() {
47  }
48 
49  /**
50  * Android 操作系统分类 ,默认为 AVChatOSCategory.OS_DEFAULT ,参考{@link AVChatOSCategory} ,
51  */
52  public Builder osType(int osType) {
53  this.osType = osType;
54  return this;
55  }
56 
57  /**
58  * 是否为低功耗,默认false
59  */
60  public Builder lowEnergy(boolean lowEnergy) {
61  this.lowEnergy = lowEnergy;
62  return this;
63  }
64 
65  /**
66  * 私有化相关的地址配置,默认为null
67  *
68  * @see AVChatServerAddresses
69  */
70  public Builder serverAddresses(AVChatServerAddresses serverAddresses) {
71 
72  this.serverAddresses = serverAddresses;
73  return this;
74 
75  }
76 
77 
78  public AVChatEngineConfig build() {
80  config.osType = osType;
81  config.lowEnergy = lowEnergy;
82  config.serverAddresses = serverAddresses;
83  return config;
84  }
85 
86  }
87 
88 
89 }
引擎初始化的一些自定义配置,使用Builder 去构造