StorageConfigVo.java
942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.viontech.storage.vo;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.json.JSONUtil;
import com.viontech.storage.entity.Context;
import com.viontech.storage.model.StorageConfig;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* .
*
* @author 谢明辉
* @date 2021/11/8
*/
@Getter
@Setter
public class StorageConfigVo extends StorageConfig {
private List<Context> contexts;
private String nameLike;
public static StorageConfigVo copy(StorageConfig storageConfig) {
if (storageConfig == null) {
return null;
}
StorageConfigVo storageConfigVo = new StorageConfigVo();
BeanUtil.copyProperties(storageConfig, storageConfigVo, true);
if (storageConfigVo.getContext() != null) {
storageConfigVo.setContexts(JSONUtil.toList(storageConfigVo.getContext(), Context.class));
}
return storageConfigVo;
}
}