Project

General

Profile

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

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

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

    
17
import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
18

    
19
import eu.etaxonomy.cdm.model.common.Language;
20
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
21
import eu.etaxonomy.cdm.model.term.EnumeratedTermVoc;
22
import eu.etaxonomy.cdm.model.term.IEnumTerm;
23

    
24
/**
25
 * Enumeration for the taxon name registration status.
26
 *
27
 * @author a.mueller
28
 * @since 13.03.2017
29
 */
30
@XmlEnum
31
public enum RegistrationStatus implements IEnumTerm<RegistrationStatus>{
32

    
33
    /**
34
     * A new record which is being edited by the Author
35
     */
36
    @XmlEnumValue("Preparation")
37
    PREPARATION(UUID.fromString("032c4f0c-af74-4f10-82f9-0652209bfeac"), "Preparation","PREP"),
38

    
39
    /**
40
     * A record ready for the curator to be validated.
41
     */
42
    @XmlEnumValue("Curation")
43
    CURATION(UUID.fromString("4b8f972e-06a2-423c-827e-6477a2a9d371"), "Curation","CUR"),
44

    
45
    /**
46
     * The record has passed the validation by the curator and is ready for publication.
47
     */
48
    @XmlEnumValue("Ready")
49
    READY(UUID.fromString("6fe00e6d-56fc-4150-a1ef-7a47ea764f18"), "Ready","RDY"),
50

    
51
    /**
52
     * The name or typification has finally been published.
53
     */
54
    @XmlEnumValue("Published")
55
    PUBLISHED(UUID.fromString("9bcc6bea-424a-4bfe-b901-2efeea116c2c"), "Unknown unit type","PUB"),
56

    
57
    /**
58
     * The registration has been rejected, the process is aborted and the record is preserved.
59
     */
60
    @XmlEnumValue("Rejected")
61
    REJECTED(UUID.fromString("0960e14a-a6b1-41b4-92a9-0d6d1b9e0159"), "Unknown unit type","REJ"),
62
    ;
63

    
64
    private final Logger logger = LogManager.getLogger(RegistrationStatus.class);
65

    
66

    
67
    private RegistrationStatus(UUID uuid, String defaultString, String key){
68
        this(uuid, defaultString, key, null);
69
        logger.debug("SpecimenOrObservationType hierarchie not yet fully implemented");
70
    }
71

    
72
    @SuppressWarnings("unchecked")
73
    private RegistrationStatus(UUID uuid, String defaultString, String key, SpecimenOrObservationType parent){
74
        delegateVocTerm = EnumeratedTermVoc.addTerm(getClass(), this, uuid, defaultString, key, parent);
75
    }
76

    
77
    // *************************** DELEGATE **************************************/
78

    
79
    private static EnumeratedTermVoc<RegistrationStatus> delegateVoc;
80
    private IEnumTerm<RegistrationStatus> delegateVocTerm;
81

    
82
    static {
83
        delegateVoc = EnumeratedTermVoc.getVoc(RegistrationStatus.class);
84
    }
85

    
86
    @Override
87
    public String getKey(){return delegateVocTerm.getKey();}
88

    
89
    @Override
90
    public String getLabel(){return delegateVocTerm.getLabel();}
91

    
92
    @Override
93
    public String getLabel(Language language){return delegateVocTerm.getLabel(language);}
94

    
95

    
96
    @Override
97
    public UUID getUuid() {return delegateVocTerm.getUuid();}
98

    
99
    @Override
100
    public RegistrationStatus getKindOf() {return delegateVocTerm.getKindOf();}
101

    
102
    @Override
103
    public Set<RegistrationStatus> getGeneralizationOf() {return delegateVocTerm.getGeneralizationOf();}
104

    
105
    @Override
106
    public boolean isKindOf(RegistrationStatus ancestor) {return delegateVocTerm.isKindOf(ancestor); }
107

    
108
    @Override
109
    public Set<RegistrationStatus> getGeneralizationOf(boolean recursive) {return delegateVocTerm.getGeneralizationOf(recursive);}
110

    
111
    public static RegistrationStatus getByKey(String key){return delegateVoc.getByKey(key);}
112
    public static RegistrationStatus getByUuid(UUID uuid) {return delegateVoc.getByUuid(uuid);}
113

    
114

    
115
}
(29-29/39)