package com.vci.ubcs.file.enumpck;
|
|
|
import com.vci.ubcs.file.constant.VciFileEnumConstant;
|
import com.vci.ubcs.starter.annotation.VciEnum;
|
import com.vci.ubcs.starter.web.enumpck.BaseEnum;
|
|
/**
|
* 文件传输的协议方式
|
* @author weidy
|
* @date 2020/3/11
|
*/
|
@VciEnum(name = VciFileEnumConstant.FILE_TRANS_PROTOCOL,text = "文件传输的协议")
|
public enum VciFileTransProtocolEnum implements BaseEnum {
|
/**
|
* 平台原有的CORBA服务
|
*/
|
CORBA("corba","平台原有的CORBA服务"),
|
/**
|
* minio轻量化文件服务
|
*/
|
MINIO("minio","轻量化文件服务"),
|
/**
|
* mongoDB分布式文件服务
|
*/
|
MONGO("mongo","mongoDB分布式文件服务"),
|
/**
|
* 存储到FTP服务中
|
*/
|
FTP("ftp","存储到FTP服务中"),
|
/**
|
* 下载成功
|
*/
|
LOCAL("local","本地存储"),
|
|
/**
|
* HTTP查看
|
*/
|
HTTP("http","仅使用HTTP查看"),
|
/**
|
* NAS服务上存储
|
*/
|
NAS("nas","NAS服务上存储"),
|
|
/**
|
* Thrift远程调用
|
*/
|
THRIFT("thrift","Thrift远程调用");
|
|
/**
|
* 枚举值
|
*/
|
private String value;
|
|
/**
|
* 枚举显示值
|
*/
|
private String text;
|
/**
|
* 获取枚举值
|
* @return 枚举值
|
*/
|
@Override
|
public String getValue() {
|
return value;
|
}
|
|
/**
|
* 设置枚举值
|
* @param value 枚举值
|
*/
|
public void setValue(String value) {
|
this.value = value;
|
}
|
|
/**
|
* 获取显示文本
|
* @return 显示文本
|
*/
|
@Override
|
public String getText() {
|
return text;
|
}
|
|
/**
|
* 设置显示文本
|
* @param text 显示文本
|
*/
|
public void setText(String text) {
|
this.text = text;
|
}
|
|
|
/**
|
* 内部构造函数
|
* @param value 枚举的值
|
*/
|
private VciFileTransProtocolEnum(String value, String text){
|
this.value = value;
|
this.text = text;
|
}
|
|
/**
|
* 根据名称获取对应的枚举值
|
* @param text 名称
|
* @return 枚举值
|
*/
|
public static String getValueByText(String text){
|
for(VciFileTransProtocolEnum wenum : VciFileTransProtocolEnum.values()){
|
if(wenum.getText().equalsIgnoreCase(text)){
|
return wenum.getValue();
|
}
|
}
|
return "";
|
}
|
|
/**
|
* 根据枚举值获取名称
|
* @param value 枚举值
|
* @return 名称
|
*/
|
public static String getTextByValue(String value){
|
for(VciFileTransProtocolEnum wenum : VciFileTransProtocolEnum.values()){
|
if(wenum.getValue().equalsIgnoreCase(value)){
|
return wenum.getText();
|
}
|
}
|
return "";
|
}
|
|
/**
|
* 根据枚举值获取枚举对象
|
* @param value 枚举值
|
* @return 枚举对象
|
*/
|
public static VciFileTransProtocolEnum forValue(String value){
|
for(VciFileTransProtocolEnum wenum : VciFileTransProtocolEnum.values()){
|
if(wenum.getValue().equalsIgnoreCase(value)){
|
return wenum;
|
}
|
}
|
return null;
|
}
|
|
}
|