CenterType添加String转Type的方法

This commit is contained in:
ascrutae 2016-11-10 07:41:01 +08:00
parent 25dbe41aee
commit 4b95a829e2
1 changed files with 8 additions and 0 deletions

View File

@ -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 + "]");
}
}