NIMSDK-AOS  10.9.50
V2NIMRouteConfig.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.v2.auth.config;
2 
3 import java.io.Serializable;
4 
5 public class V2NIMRouteConfig implements Serializable {
6 
7  /**
8  * 是否需要路由消息。(抄送)
9  * 抄送需要打开控制台抄送配置
10  */
11  private final boolean routeEnabled;
12 
13  /**
14  * 环境变量,用于指向不同的抄送,第三方回调等配置如果不填,则使用控制台默认抄送地址
15  */
16  private final String routeEnvironment;
17 
18  private V2NIMRouteConfig() {
19  this(DEFAULT_ROUTE_ENABLED, null);
20  }
21 
22  public V2NIMRouteConfig(boolean routeEnabled, String routeEnvironment) {
23  this.routeEnabled = routeEnabled;
24  this.routeEnvironment = routeEnvironment;
25  }
26 
27  public boolean isRouteEnabled() {
28  return routeEnabled;
29  }
30 
31  public String getRouteEnvironment() {
32  return routeEnvironment;
33  }
34 
35  @Override
36  public String toString() {
37  return "V2NIMRouteConfig{" +
38  "routeEnabled=" + routeEnabled +
39  ", routeEnvironment='" + routeEnvironment + '\'' +
40  '}';
41  }
42 
43  private static final boolean DEFAULT_ROUTE_ENABLED = true;
44 
45  public static final class V2NIMRouteConfigBuilder {
46  private boolean routeEnabled = DEFAULT_ROUTE_ENABLED;
47  private String routeEnvironment;
48 
49  private V2NIMRouteConfigBuilder() {
50  }
51 
52  public static V2NIMRouteConfigBuilder builder() {
53  return new V2NIMRouteConfigBuilder();
54  }
55 
56  public V2NIMRouteConfigBuilder withRouteEnabled(boolean routeEnabled) {
57  this.routeEnabled = routeEnabled;
58  return this;
59  }
60 
61  public V2NIMRouteConfigBuilder withRouteEnvironment(String routeEnvironment) {
62  this.routeEnvironment = routeEnvironment;
63  return this;
64  }
65 
66  public V2NIMRouteConfig build() {
67  return new V2NIMRouteConfig(routeEnabled, routeEnvironment);
68  }
69  }
70 }
V2NIMRouteConfig(boolean routeEnabled, String routeEnvironment)