虚拟属性数据校验及参数赋值问题

yun-zuoyi
汪云昊 5 years ago
parent 5a6a7a77fc
commit 101a71970c

@ -5,7 +5,6 @@ import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.persistence.Transient;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;

@ -918,4 +918,147 @@ public class BlockSoftSwitchEnumUtil {
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BS_SCRIPT_TYPE {
MESSAGE_PROCESS(10, "报文处理","可用参数:transData,orginData");
private int value;
private String description;
private String scriptRule;
private BS_SCRIPT_TYPE (int value, String description,String scriptRule) {
this.value = value;
this.description = description;
this.scriptRule = scriptRule;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getScriptRule() {
return scriptRule;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public static BS_SCRIPT_TYPE valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BS_SCRIPT_LANGUAGE {
// SPEL(10, "Spring表达式语言(SpEL)"),
JAVASCRIPT(20, "JavaScript(JS)");
private int value;
private String description;
private BS_SCRIPT_LANGUAGE (int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public static BS_SCRIPT_LANGUAGE valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BS_SCRIPT_EXECUTE_METHOD {
EXECUTE_SCRIPT(10, "执行脚本"),
EXECUTE_METHOD(20, "执行方法"),
EXECUTE_OBJECT_METHOD(30, "执行对象方法");
private int value;
private String description;
private BS_SCRIPT_EXECUTE_METHOD (int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public static BS_SCRIPT_EXECUTE_METHOD valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
}
}

Loading…
Cancel
Save