CenterType添加String转Type的方法
This commit is contained in:
parent
25dbe41aee
commit
4b95a829e2
|
|
@ -16,4 +16,12 @@ public enum CenterType {
|
|||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public static CenterType convert(String type) {
|
||||
if (zookeeper.type.equals(type)) {
|
||||
return zookeeper;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Failed to find center type[" + type + "]");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue