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 12.09.2019
|
14
|
*/
|
15
|
public enum TermSearchField implements IKeyLabel{
|
16
|
|
17
|
IDInVocabulary("idInVocabulary", "ID in vocabulary"),
|
18
|
Symbol1("symbol1", "First symbol"),
|
19
|
Symbol2("symbol2", "Second symbol"),
|
20
|
NoAbbrev("titleCache", "Title cache");
|
21
|
|
22
|
private String label;
|
23
|
private String key;
|
24
|
|
25
|
private TermSearchField(String key, String label){
|
26
|
this.label = label;
|
27
|
this.key = key;
|
28
|
}
|
29
|
|
30
|
@Override
|
31
|
public String getLabel() {
|
32
|
return label;
|
33
|
}
|
34
|
|
35
|
@Override
|
36
|
public String getKey() {
|
37
|
return key;
|
38
|
}
|
39
|
|
40
|
public static TermSearchField byKey(String key){
|
41
|
for (TermSearchField searchField : values()){
|
42
|
if (searchField.key.equals(key)){
|
43
|
return searchField;
|
44
|
}
|
45
|
}
|
46
|
throw new IllegalArgumentException();
|
47
|
}
|
48
|
}
|