Project

General

Profile

Download (3.38 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2020 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.taxon;
10

    
11
import java.util.Set;
12
import java.util.UUID;
13

    
14
import javax.xml.bind.annotation.XmlEnumValue;
15

    
16
import org.apache.log4j.Logger;
17

    
18
import eu.etaxonomy.cdm.model.common.Language;
19
import eu.etaxonomy.cdm.model.term.EnumeratedTermVoc;
20
import eu.etaxonomy.cdm.model.term.IEnumTerm;
21

    
22
/**
23
 * @author a.mueller
24
 * @since 26.05.2020
25
 */
26
public enum TaxonNodeStatus implements IEnumTerm<TaxonNodeStatus>{
27

    
28
    //0  - see #8281
29
    /**
30
     * The placement of the taxon is doubtful or preliminary.
31
     */
32
    @XmlEnumValue("Doubtful")
33
    DOUBTFUL(UUID.fromString("022ebae2-a020-4a8d-8ee1-886d98d3a4db"), "Doubtful", "DOU", "?", null),
34

    
35
    //1
36
    /**
37
     * The taxon is not placed to the correct place (yet). Instead it is  placed here.
38
     */
39
    @XmlEnumValue("Unplaced")
40
    UNPLACED(UUID.fromString("92809dee-8b3f-4fd5-a915-638d7c86b351"), "Unplaced", "UNP", "??", null),
41

    
42
    //2
43
    /**
44
     * The taxon for some reason is excluded from the treatment this {@link TaxonNode} belongs too.
45
     */
46
    @XmlEnumValue("Excluded")
47
    EXCLUDED(UUID.fromString("23d259b6-2d7e-4df6-8745-0e24fbe63187"), "Excluded", "EXC", Character.toString((char)248), null)
48
    ;
49

    
50
// **************** END ENUM **********************/
51

    
52
    @SuppressWarnings("unused")
53
    private static final Logger logger = Logger.getLogger(TaxonNodeStatus.class);
54

    
55
    private String symbol;
56

    
57
    private TaxonNodeStatus(UUID uuid, String defaultString, String key, String symbol){
58
        this(uuid, defaultString, key, symbol, null);
59
    }
60

    
61
    private TaxonNodeStatus(UUID uuid, String defaultString, String key, String symbol, TaxonNodeStatus parent){
62
        delegateVocTerm = EnumeratedTermVoc.addTerm(getClass(), this, uuid, defaultString, key, parent);
63
        this.symbol = symbol;
64
    }
65

    
66

    
67
// *************************** DELEGATE **************************************/
68

    
69
    private static EnumeratedTermVoc<TaxonNodeStatus> delegateVoc;
70
    private IEnumTerm<TaxonNodeStatus> delegateVocTerm;
71

    
72
    static {
73
        delegateVoc = EnumeratedTermVoc.getVoc(TaxonNodeStatus.class);
74
    }
75

    
76
    @Override
77
    public String getKey(){return delegateVocTerm.getKey();}
78

    
79
    @Override
80
    public String getLabel(){return delegateVocTerm.getLabel();}
81

    
82
    @Override
83
    public String getLabel(Language language){return delegateVocTerm.getLabel(language);}
84

    
85
    @Override
86
    public UUID getUuid() {return delegateVocTerm.getUuid();}
87

    
88
    @Override
89
    public TaxonNodeStatus getKindOf() {return delegateVocTerm.getKindOf();}
90

    
91
    @Override
92
    public Set<TaxonNodeStatus> getGeneralizationOf() {return delegateVocTerm.getGeneralizationOf();}
93

    
94
    @Override
95
    public boolean isKindOf(TaxonNodeStatus ancestor) {return delegateVocTerm.isKindOf(ancestor);  }
96

    
97
    @Override
98
    public Set<TaxonNodeStatus> getGeneralizationOf(boolean recursive) {return delegateVocTerm.getGeneralizationOf(recursive);}
99

    
100
    public static TaxonNodeStatus getByKey(String key){return delegateVoc.getByKey(key);}
101
    public static TaxonNodeStatus getByUuid(UUID uuid) {return delegateVoc.getByUuid(uuid);}
102

    
103
//**************** symbol **********************/
104

    
105
    public String getSymbol(){
106
        return symbol;
107
    }
108

    
109
}
(17-17/21)