package com.nova.sankuai.domain.enums;
|
|
import io.swagger.annotations.ApiModel;
|
import org.apache.commons.lang.StringUtils;
|
|
/**
|
* @author weikangdi
|
* 产品类型
|
*/
|
@ApiModel(value = "机构信息-产品类型枚举")
|
public enum ProductTypeEnum {
|
PROVIDENT_FUND_LOAN(0, "公积金贷"),
|
HOUSE_LOAN(1, "房抵贷"),
|
CAR_LOAN(2, "车抵贷"),
|
INVOICE_LOAN(3, "发票贷"),
|
TAX_LOAN(4, "税务贷"),
|
LARGE_CREDIT_LOAN(5, "大额信用贷"),
|
POLICY_LOAN(6, "保单贷"),
|
OTHER(7, "其他");
|
|
private Integer code;
|
private String value;
|
|
ProductTypeEnum(int code, String value) {
|
this.code = code;
|
this.value = value;
|
}
|
|
public static String value(int code) {
|
for (ProductTypeEnum m : ProductTypeEnum.values()) {
|
if (m.getCode() == code) {
|
return m.getValue();
|
}
|
}
|
return null;
|
}
|
|
public static String getValues(String ids) {
|
String resultStr = "";
|
String[] split = ids.split(",");
|
for (String code : split) {
|
String value = value(Integer.parseInt(code));
|
if (StringUtils.isNotBlank(value)) {
|
resultStr = StringUtils.isNotBlank(resultStr) ? resultStr + "," + value : resultStr + value;
|
}
|
}
|
return resultStr;
|
}
|
|
public Integer getCode() {
|
return code;
|
}
|
|
public void setCode(Integer code) {
|
this.code = code;
|
}
|
|
public String getValue() {
|
return value;
|
}
|
|
public void setValue(String value) {
|
this.value = value;
|
}
|
}
|