package policy; public enum PolicyLevel { Standard(null , 0), Agreement("协议分解", 1),Record("手动录入", 2); private String source; private int level; private PolicyLevel(String source, int level) { this.source = source; this.level = level; } public int getLevel() { return level*10; } public static PolicyLevel parse(String source) { if("协议分解".equalsIgnoreCase(source)) { return Agreement; } else if("手动录入".equalsIgnoreCase(source)) { return Record; } else { return Standard; } } public String getSource() { return source; } }