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 03.06.2019
|
14
|
*
|
15
|
*/
|
16
|
public enum TermComboEnum implements IKeyLabel{
|
17
|
|
18
|
IdInVocabulary("IdInVocabulary", "ID in Vocabulary"),
|
19
|
Symbol1("Symbol1", "Symbol 1"),
|
20
|
Symbol2("Symbol2", "Symbol 2"),
|
21
|
Title("Label", "Label"),
|
22
|
TermDisplayPlusTitle("TermDisplay+Label", "[Term Display] Label");
|
23
|
|
24
|
String label;
|
25
|
String key;
|
26
|
|
27
|
private TermComboEnum(String key, String label){
|
28
|
this.label = label;
|
29
|
this.key = key;
|
30
|
}
|
31
|
|
32
|
@Override
|
33
|
public String getLabel(){
|
34
|
return label;
|
35
|
}
|
36
|
|
37
|
@Override
|
38
|
public String getKey(){
|
39
|
return key;
|
40
|
}
|
41
|
|
42
|
public static TermComboEnum byKey(String key){
|
43
|
for (TermComboEnum termDisplay : values()){
|
44
|
if (termDisplay.key.equals(key)){
|
45
|
return termDisplay;
|
46
|
}
|
47
|
}
|
48
|
throw new IllegalArgumentException();
|
49
|
}
|
50
|
|
51
|
@Override
|
52
|
public String toString(){
|
53
|
return key;
|
54
|
}
|
55
|
}
|