NIMSDK-AOS  10.5.0
NosConfig.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.misc.model;
2 
3 import android.text.TextUtils;
4 
5 import androidx.annotation.NonNull;
6 
7 public class NosConfig {
9  final private String bucket;
11  final private String cdnDomain;
13  final private long deadline;
15  final private String objectNamePrefix;
16 
17  public NosConfig(String bucket, @NonNull String cdnDomain, long deadline, String objectNamePrefix) {
18  this.bucket = bucket;
19  this.cdnDomain = cdnDomain;
20  this.deadline = deadline;
21  this.objectNamePrefix = objectNamePrefix;
22  }
23 
24  public String getBucket() {
25  return bucket;
26  }
27 
28  public String getCdnDomain() {
29  return cdnDomain;
30  }
31 
32  public long getDeadline() {
33  return deadline;
34  }
35 
36  public String getObjectNamePrefix() {
37  return objectNamePrefix;
38  }
39 
40  public boolean isValid() {
41  return deadline != 0 && !TextUtils.isEmpty(cdnDomain);
42  }
43 
44  public boolean isValidForever() {
45  return deadline == -1;
46  }
47 
48  @Override
49  public String toString() {
50  return "NosConfig{" +
51  "bucket='" + bucket + '\'' +
52  ", cdnDomain='" + cdnDomain + '\'' +
53  ", deadline=" + deadline +
54  ", objectNamePrefix='" + objectNamePrefix + '\'' +
55  '}';
56  }
57 }
NosConfig(String bucket, @NonNull String cdnDomain, long deadline, String objectNamePrefix)
Definition: NosConfig.java:17