Last active
May 8, 2019 07:49
-
-
Save naffan2014/e54cd7fb803e67f54717ba0ffe8a602b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum FieldSourceEnum { | |
CONTRACT(1, "备件/合同", new LinkedList<SourceType>() {{ | |
{ | |
add(SourceType.CONTRACT); | |
} | |
}}), | |
CONTRACT_AGENT(2, "备件/合同>经纪人", new LinkedList<SourceType>() {{ | |
{ | |
add(SourceType.CONTRACT); | |
add(SourceType.AGENT); | |
} | |
}}), | |
CONTRACT_INFERENCE_AGENT(3, "备件/合同>逻辑推断>经纪人", new LinkedList<SourceType>() {{ | |
{ | |
add(SourceType.CONTRACT); | |
add(SourceType.INFERENCE); | |
add(SourceType.AGENT); | |
} | |
}}), | |
CONTRACT_INFERENCE_AGENT_HISTORY(4, "备件/合同>逻辑推断>经纪人>历史", new LinkedList<SourceType>() {{ | |
{ | |
add(SourceType.CONTRACT); | |
add(SourceType.INFERENCE); | |
add(SourceType.AGENT); | |
add(SourceType.HISTORY); | |
} | |
}}); | |
public static FieldSourceEnum getById(Integer id) { | |
for (FieldSourceEnum fieldSourceEnum : FieldSourceEnum.values()) { | |
if (id == fieldSourceEnum.getId()) { | |
return fieldSourceEnum; | |
} | |
} | |
return CONTRACT; | |
} | |
private int id; | |
private String name; | |
private LinkedList<SourceType> type; | |
FieldSourceEnum(int id, String name, LinkedList<SourceType> type) { | |
this.id = id; | |
this.name = name; | |
this.type = type; | |
} | |
public int getId() { | |
return id; | |
} | |
public String getName() { | |
return name; | |
} | |
public LinkedList<SourceType> getType() { | |
return type; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment