Project

General

Profile

Download (3.37 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.term.EnumeratedTermVoc;
19
import eu.etaxonomy.cdm.model.term.IEnumTerm;
20

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

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

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

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

    
49
// **************** END ENUM **********************/
50

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

    
54
    private String symbol;
55

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

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

    
65

    
66
// *************************** DELEGATE **************************************/
67

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

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

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

    
78
    @Override
79
    public String getMessage(){return delegateVocTerm.getMessage();}
80

    
81
    @Override
82
    public String getMessage(eu.etaxonomy.cdm.model.common.Language language){return delegateVocTerm.getMessage(language);}
83

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

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

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

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

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

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

    
102
//**************** symbol **********************/
103

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

    
108
}
(17-17/21)