1
|
/**
|
2
|
* Copyright (C) 2019 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.model.metadata;
|
10
|
|
11
|
/**
|
12
|
* @author k.luther
|
13
|
* @since 09.01.2019
|
14
|
*
|
15
|
*/
|
16
|
public enum TermDisplayEnum {
|
17
|
IdInVocabulary("IdInVocabulary", "ID in Vocabulary"),
|
18
|
Symbol1("Symbol1", "Symbol 1"),
|
19
|
Symbol2("Symbol2", "Symbol 2"),
|
20
|
Title("Label", "Label");
|
21
|
|
22
|
String label;
|
23
|
String key;
|
24
|
|
25
|
private TermDisplayEnum(String key, String label){
|
26
|
this.label = label;
|
27
|
this.key = key;
|
28
|
}
|
29
|
|
30
|
public String getLabel(){
|
31
|
return label;
|
32
|
}
|
33
|
|
34
|
public String getKey(){
|
35
|
return key;
|
36
|
}
|
37
|
|
38
|
public TermDisplayEnum byKey(String key){
|
39
|
if (key == null){
|
40
|
return null;
|
41
|
}
|
42
|
for (TermDisplayEnum termDisplay : values()){
|
43
|
if (termDisplay.key.equals(key)){
|
44
|
return termDisplay;
|
45
|
}
|
46
|
}
|
47
|
return null;
|
48
|
}
|
49
|
}
|