反序列化问题。
This commit is contained in:
parent
35b19e1198
commit
78c35ce6e4
@ -142,25 +142,25 @@ public enum NodeTypeEnums {
|
|||||||
private final String name;
|
private final String name;
|
||||||
private final NodeUiConfig uiConfig;
|
private final NodeUiConfig uiConfig;
|
||||||
|
|
||||||
NodeTypeEnums(String value, String description, NodeUiConfig uiConfig) {
|
NodeTypeEnums(String code, String name, NodeUiConfig uiConfig) {
|
||||||
this.code = value;
|
this.code = code;
|
||||||
this.name = description;
|
this.name = name;
|
||||||
this.uiConfig = uiConfig;
|
this.uiConfig = uiConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据值查找对应的枚举
|
* 根据值查找对应的枚举
|
||||||
*
|
*
|
||||||
* @param value 枚举值
|
* @param code 枚举值
|
||||||
* @return 对应的枚举实例
|
* @return 对应的枚举实例
|
||||||
* @throws IllegalArgumentException 当找不到对应的枚举值时抛出
|
* @throws IllegalArgumentException 当找不到对应的枚举值时抛出
|
||||||
*/
|
*/
|
||||||
public static NodeTypeEnums fromValue(String value) {
|
public static NodeTypeEnums fromValue(String code) {
|
||||||
for (NodeTypeEnums type : values()) {
|
for (NodeTypeEnums type : values()) {
|
||||||
if (type.code.equals(value)) {
|
if (type.code.equals(code)) {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new IllegalArgumentException("Unknown NodeType value: " + value);
|
throw new IllegalArgumentException("Unknown NodeType value: " + code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user