NIMSDK-AOS
10.9.80
首页
相关页面
包
类
文件
文件列表
basesdk
src
com
netease
nimlib
sdk
v2
message
attachment
builder
V2NIMMessageVideoAttachmentBuilder.java
浏览该文件的文档.
1
package
com.netease.nimlib.sdk.v2.message.attachment.builder;
2
3
import
com
.
netease
.
nimlib
.
sdk
.
v2
.
message
.
attachment
.
V2NIMMessageVideoAttachment
;
4
import
com
.
netease
.
nimlib
.
sdk
.
v2
.
storage
.
V2NIMStorageSceneConfig
;
5
import
com
.
netease
.
nimlib
.v2.message.impl.attachment.V2NIMMessageVideoAttachmentImpl;
6
7
/**
8
* 视频消息附件构建器类
9
* 用于构建视频消息附件对象
10
*/
11
public
final
class
V2NIMMessageVideoAttachmentBuilder
{
12
13
/**
14
* 文件路径
15
*/
16
private
String path;
17
/**
18
* 文件显示名称
19
*/
20
private
String name;
21
/**
22
* 文件大小
23
*/
24
private
long
size;
25
/**
26
* 文件存储场景名
27
* 默认为{@link com.netease.nimlib.sdk.v2.storage.V2NIMStorageSceneConfig#DEFAULT_IM}的getSceneName()值
28
*/
29
private
String sceneName =
V2NIMStorageSceneConfig
.
DEFAULT_IM
.
getSceneName
();
30
/**
31
* 文件MD5
32
*/
33
private
String md5;
34
/**
35
* 文件上传服务器路径
36
*/
37
private
String url;
38
/**
39
* 文件后缀名
40
*/
41
private
String ext;
42
/**
43
* 视频宽度
44
*/
45
private
int
width;
46
/**
47
* 视频高度
48
*/
49
private
int
height;
50
/**
51
* 视频时长
52
*/
53
private
int
duration;
54
55
/**
56
* 私有构造函数
57
*/
58
private
V2NIMMessageVideoAttachmentBuilder
() {
59
}
60
61
/**
62
* 创建一个新的视频消息附件构建器实例
63
* @return 新的视频消息附件构建器实例
64
*/
65
public
static
V2NIMMessageVideoAttachmentBuilder
builder
() {
66
return
new
V2NIMMessageVideoAttachmentBuilder
();
67
}
68
69
/**
70
* 设置文件路径
71
* @param path 文件路径
72
* @return 当前构建器实例
73
*/
74
public
V2NIMMessageVideoAttachmentBuilder
withPath
(String path) {
75
this.path = path;
76
return
this
;
77
}
78
79
/**
80
* 设置文件显示名称
81
* @param name 文件显示名称
82
* @return 当前构建器实例
83
*/
84
public
V2NIMMessageVideoAttachmentBuilder
withName
(String name) {
85
this.name = name;
86
return
this
;
87
}
88
89
/**
90
* 设置文件大小,如果小于0,则不设置
91
* @param size 文件大小
92
* @return 当前构建器实例
93
*/
94
public
V2NIMMessageVideoAttachmentBuilder
withSize
(
long
size) {
95
if
(size >= 0) {
96
this.size = size;
97
}
98
return
this
;
99
}
100
101
/**
102
* 设置文件存储场景名,默认为{@link com.netease.nimlib.sdk.v2.storage.V2NIMStorageSceneConfig#DEFAULT_IM}的getSceneName()值
103
* @param sceneName 存储场景名
104
* @return 当前构建器实例
105
*/
106
public
V2NIMMessageVideoAttachmentBuilder
withSceneName
(String sceneName) {
107
this.sceneName = sceneName;
108
return
this
;
109
}
110
111
/**
112
* 设置文件MD5
113
* @param md5 文件MD5
114
* @return 当前构建器实例
115
*/
116
public
V2NIMMessageVideoAttachmentBuilder
withMd5
(String md5) {
117
this.md5 = md5;
118
return
this
;
119
}
120
121
/**
122
* 设置文件上传服务器路径
123
* @param url 文件上传服务器路径
124
* @return 当前构建器实例
125
*/
126
public
V2NIMMessageVideoAttachmentBuilder
withUrl
(String url) {
127
this.url = url;
128
return
this
;
129
}
130
131
/**
132
* 设置文件后缀名
133
* @param ext 文件后缀名
134
* @return 当前构建器实例
135
*/
136
public
V2NIMMessageVideoAttachmentBuilder
withExt
(String ext) {
137
this.ext = ext;
138
return
this
;
139
}
140
141
/**
142
* 设置视频宽度,如果小于0,则不设置
143
* @param width 视频宽度
144
* @return 当前构建器实例
145
*/
146
public
V2NIMMessageVideoAttachmentBuilder
withWidth
(
int
width) {
147
if
(width >= 0){
148
this.width = width;
149
}
150
return
this
;
151
}
152
153
/**
154
* 设置视频高度,如果小于0,则不设置
155
* @param height 视频高度
156
* @return 当前构建器实例
157
*/
158
public
V2NIMMessageVideoAttachmentBuilder
withHeight
(
int
height) {
159
if
(height >= 0){
160
this.height = height;
161
}
162
return
this
;
163
}
164
165
/**
166
* 设置视频时长,如果小于0,则不设置
167
* @param duration 视频时长
168
* @return 当前构建器实例
169
*/
170
public
V2NIMMessageVideoAttachmentBuilder
withDuration
(
int
duration) {
171
if
(duration >= 0){
172
this.duration = duration;
173
}
174
return
this
;
175
}
176
177
/**
178
* 构建视频消息附件对象
179
* @return 构建的视频消息附件对象
180
*/
181
public
V2NIMMessageVideoAttachment
build
() {
182
return
new
V2NIMMessageVideoAttachmentImpl(path, size, md5, url, ext, name, sceneName, null, duration, width, height);
183
}
184
}
com.netease.nimlib.sdk.v2.message.attachment.builder.V2NIMMessageVideoAttachmentBuilder.withHeight
V2NIMMessageVideoAttachmentBuilder withHeight(int height)
设置视频高度,如果小于0,则不设置
Definition:
V2NIMMessageVideoAttachmentBuilder.java:158
com.netease.nimlib.sdk.v2.message.attachment.builder.V2NIMMessageVideoAttachmentBuilder.withSceneName
V2NIMMessageVideoAttachmentBuilder withSceneName(String sceneName)
设置文件存储场景名,默认为com.netease.nimlib.sdk.v2.storage.V2NIMStorageSceneConfig#DEFAULT_IM的getSc...
Definition:
V2NIMMessageVideoAttachmentBuilder.java:106
com.netease.nimlib.sdk
Definition:
NosTokenSceneConfig.java:1
com.netease.nimlib.sdk.v2.message.attachment.builder.V2NIMMessageVideoAttachmentBuilder.build
V2NIMMessageVideoAttachment build()
构建视频消息附件对象
Definition:
V2NIMMessageVideoAttachmentBuilder.java:181
com.netease
com
com.netease.nimlib.sdk.v2.message.attachment.builder.V2NIMMessageVideoAttachmentBuilder.withExt
V2NIMMessageVideoAttachmentBuilder withExt(String ext)
设置文件后缀名
Definition:
V2NIMMessageVideoAttachmentBuilder.java:136
com.netease.nimlib.sdk.v2.message.attachment.builder.V2NIMMessageVideoAttachmentBuilder
视频消息附件构建器类 用于构建视频消息附件对象
Definition:
V2NIMMessageVideoAttachmentBuilder.java:11
com.netease.nimlib.sdk.v2.message.attachment.builder.V2NIMMessageVideoAttachmentBuilder.withDuration
V2NIMMessageVideoAttachmentBuilder withDuration(int duration)
设置视频时长,如果小于0,则不设置
Definition:
V2NIMMessageVideoAttachmentBuilder.java:170
com.netease.nimlib.sdk.v2.message.attachment.builder.V2NIMMessageVideoAttachmentBuilder.withPath
V2NIMMessageVideoAttachmentBuilder withPath(String path)
设置文件路径
Definition:
V2NIMMessageVideoAttachmentBuilder.java:74
com.netease.nimlib.sdk.v2.storage
Definition:
V2NIMUploadFileParams.java:1
com.netease.nimlib.sdk.v2.storage.V2NIMStorageSceneConfig
文件存储场景
Definition:
V2NIMStorageSceneConfig.java:8
com.netease.nimlib.sdk.v2.storage.V2NIMStorageScene.getSceneName
String getSceneName()
返回场景名
com.netease.nimlib.sdk.v2.message.attachment.builder.V2NIMMessageVideoAttachmentBuilder.withMd5
V2NIMMessageVideoAttachmentBuilder withMd5(String md5)
设置文件MD5
Definition:
V2NIMMessageVideoAttachmentBuilder.java:116
com.netease.nimlib.sdk.v2.message
com.netease.nimlib.sdk.v2
com.netease.nimlib.sdk.v2.message.attachment.builder.V2NIMMessageVideoAttachmentBuilder.withSize
V2NIMMessageVideoAttachmentBuilder withSize(long size)
设置文件大小,如果小于0,则不设置
Definition:
V2NIMMessageVideoAttachmentBuilder.java:94
com.netease.nimlib.sdk.v2.message.attachment
Definition:
V2NIMMessageCallAttachment.java:1
com.netease.nimlib.sdk.v2.storage.V2NIMStorageSceneConfig.DEFAULT_IM
static final V2NIMStorageScene DEFAULT_IM
默认文件类型等场景 默认不过期
Definition:
V2NIMStorageSceneConfig.java:19
com.netease.nimlib.sdk.v2.message.attachment.builder.V2NIMMessageVideoAttachmentBuilder.withName
V2NIMMessageVideoAttachmentBuilder withName(String name)
设置文件显示名称
Definition:
V2NIMMessageVideoAttachmentBuilder.java:84
com.netease.nimlib.sdk.v2.message.attachment.builder.V2NIMMessageVideoAttachmentBuilder.builder
static V2NIMMessageVideoAttachmentBuilder builder()
创建一个新的视频消息附件构建器实例
Definition:
V2NIMMessageVideoAttachmentBuilder.java:65
com.netease.nimlib.sdk.v2.message.attachment.builder.V2NIMMessageVideoAttachmentBuilder.withUrl
V2NIMMessageVideoAttachmentBuilder withUrl(String url)
设置文件上传服务器路径
Definition:
V2NIMMessageVideoAttachmentBuilder.java:126
com.netease.nimlib.sdk.v2.message.attachment.V2NIMMessageVideoAttachment
Definition:
V2NIMMessageVideoAttachment.java:3
com.netease.nimlib.sdk.v2.message.attachment.builder.V2NIMMessageVideoAttachmentBuilder.withWidth
V2NIMMessageVideoAttachmentBuilder withWidth(int width)
设置视频宽度,如果小于0,则不设置
Definition:
V2NIMMessageVideoAttachmentBuilder.java:146
com.netease.nimlib
生成于 2026年 三月 20日 星期五 07:07:32 , 为 NIMSDK-AOS使用
1.8.11