Project

General

Profile

Download (1.24 KB) Statistics
| Branch: | Tag: | Revision:
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
public enum TermComboEnum implements IKeyLabel{
16

    
17
    IdInVocabulary("IdInVocabulary", "ID in Vocabulary"),
18
    Symbol1("Symbol1", "Symbol 1"),
19
    Symbol2("Symbol2", "Symbol 2"),
20
    Title("Label", "Label"),
21
    TermDisplayPlusTitle("TermDisplay+Label", "[Term Display] Label");
22

    
23
    private String label;
24
    private String key;
25

    
26
    private TermComboEnum(String key, String label){
27
        this.label = label;
28
        this.key = key;
29
    }
30

    
31
    @Override
32
    public String getLabel(){
33
        return label;
34
    }
35

    
36
    @Override
37
    public String getKey(){
38
        return key;
39
    }
40

    
41
    public static TermComboEnum byKey(String key){
42
        for (TermComboEnum termDisplay : values()){
43
            if (termDisplay.key.equals(key)){
44
                return termDisplay;
45
            }
46
        }
47
        throw new IllegalArgumentException();
48
    }
49

    
50
    @Override
51
    public String toString(){
52
        return key;
53
    }
54
}
(15-15/18)