Skip to content

Instantly share code, notes, and snippets.

@naffan2014
Last active May 8, 2019 07:49
Show Gist options
  • Save naffan2014/e54cd7fb803e67f54717ba0ffe8a602b to your computer and use it in GitHub Desktop.
Save naffan2014/e54cd7fb803e67f54717ba0ffe8a602b to your computer and use it in GitHub Desktop.
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