532b0645acd01b8da08645bb6d86c48e3cef1f13
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / taxon / TaxonNodeStatus.java
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.logging.log4j.LogManager;
17 import org.apache.logging.log4j.Logger;
18
19 import eu.etaxonomy.cdm.model.common.Language;
20 import eu.etaxonomy.cdm.model.term.EnumeratedTermVoc;
21 import eu.etaxonomy.cdm.model.term.IEnumTerm;
22
23 /**
24 * The status for the placement (taxon node) of taxon/name in classification.
25 *
26 * For more information on the status see #10096, #9005, #8281
27 *
28 * @author a.mueller
29 * @since 26.05.2020
30 */
31 public enum TaxonNodeStatus implements IEnumTerm<TaxonNodeStatus>{
32
33 //TODO maybe we want a status "Included" too, instead of making TaxonNode.status an optional
34 // attribute (see comments in #10096 attachement)
35 //0 - see #10096
36 // /**
37 // * The placement of the taxon is doubtful or preliminary.
38 // */
39 // @XmlEnumValue("Included")
40 // INCLDUDED(UUID.fromString("7601cc89-8896-4b85-a83e-91700fe45a1d"), "Included (default)","Taxon included in parent taxon (default)", "INC", "", null),
41
42 //1 - see #8281
43 /**
44 * The placement of the taxon is doubtful or preliminary.
45 */
46 @XmlEnumValue("Doubtful")
47 DOUBTFUL(UUID.fromString("022ebae2-a020-4a8d-8ee1-886d98d3a4db"), "Doubtful", "Taxon incl. in parent taxon with doubts", "DOU", "?", null),
48
49 //2
50 /**
51 * The taxon is not placed to the correct place (yet). Instead it is placed here.
52 */
53 @XmlEnumValue("Unplaced")
54 UNPLACED(UUID.fromString("92809dee-8b3f-4fd5-a915-638d7c86b351"), "Unplaced", "Taxon unplaced", "UNP", "??", null),
55
56 //3
57 /**
58 * The taxon or name for any reason is excluded from the treatment this {@link TaxonNode} belongs too.
59 * See sub status for more specific reasons.
60 */
61 @XmlEnumValue("Excluded")
62 EXCLUDED(UUID.fromString("23d259b6-2d7e-4df6-8745-0e24fbe63187"), "Excluded", "Name/taxon excluded (unspecific)", "EXC", Character.toString((char)248), null),
63
64 //4 #10096
65 /**
66 * Taxon or name excluded, geographically out of scope. <BR>
67 * E.g. a taxon that does not occur in the region of the flora treatment.
68 */
69 @XmlEnumValue("Excluded_geo")
70 EXCLUDED_GEO(UUID.fromString("a76c0fa8-e04d-421c-ac10-07a3c6770d45"), "Excluded geo.", "Taxon excl. (geographically out of scope)", "EXCG", Character.toString((char)248)+"g", EXCLUDED),
71
72 //5 #10096
73 /**
74 * Taxon or name excluded, taxonomically out of scope. <BR>
75 * E.g. name being a taxon name or synonym belonging to a taxon that is not part of the treatment.
76 */
77 @XmlEnumValue("Excluded_tax")
78 EXCLUDED_TAX(UUID.fromString("689a5821-e59d-4ec2-ae33-2331bdb39f34"),"Excluded tax.", "Taxon/name excl. (taxonomically out of sc.)", "EXCT", Character.toString((char)248)+"t", EXCLUDED),
79
80 //6 #10096
81 /**
82 * Name excluded for nomenclatural reasons. <BR>
83 * E.g. an effectively published name ascribing the name to an author who merely and correctly cited an earlier name.
84 */
85 @XmlEnumValue("Excluded_nom")
86 EXCLUDED_NOM(UUID.fromString("b4484183-6f19-4901-af96-0ab6183cebfb"), "Excluded nom.","Name excl. (for nomenclatural reasons)", "EXCN", Character.toString((char)248)+"n", EXCLUDED),
87
88 //7 #10096
89 /**
90 * Name of verified uncertain application <BR>
91 * E.g. an effectively published name ascribing the name to an author who merely and correctly cited an earlier name.<BR>
92 * Alternative symbol: ↑ or u+2BD1 (https://unicode-table.com/en/2BD1/)
93 */
94 @XmlEnumValue("Uncertain_app")
95 UNCERTAIN_APPLICATION(UUID.fromString("c87ea64a-f3d3-41fe-a4c5-dd6a8697fc46"), "Uncertain application", "Name of verified uncertain application", "UNA", Character.toString((char)248)+"a", EXCLUDED),
96
97 //8 #10096
98 /**
99 * Name of verified uncertain application <BR>
100 * E.g. an effectively published name ascribing the name to an author who merely and correctly cited an earlier name.<BR>
101 * Alternative symbol: ↑ or u+2BD1 (https://unicode-table.com/en/2BD1/)
102 */
103 @XmlEnumValue("Unresolved")
104 UNRESOLVED(UUID.fromString("ce6f2430-9662-4b78-8fc2-48b5fa9fd37e"), "Unresolved", "Unresolved name – to be further revised", "UNR", "u", null),
105
106 ;
107
108 // **************** END ENUM **********************/
109
110 @SuppressWarnings("unused")
111 private static final Logger logger = LogManager.getLogger(TaxonNodeStatus.class);
112
113 private String symbol;
114
115 private TaxonNodeStatus(UUID uuid, String label, String key, String symbol){
116 this(uuid, label, label, key, symbol, null);
117 }
118
119 private TaxonNodeStatus(UUID uuid, String label, String longLabel, String key, String symbol, TaxonNodeStatus parent){
120 delegateVocTerm = EnumeratedTermVoc.addTerm(getClass(), this, uuid, longLabel, key, parent);
121 this.symbol = symbol;
122 }
123
124
125 // *************************** DELEGATE **************************************/
126
127 private static EnumeratedTermVoc<TaxonNodeStatus> delegateVoc;
128 private IEnumTerm<TaxonNodeStatus> delegateVocTerm;
129
130 static {
131 delegateVoc = EnumeratedTermVoc.getVoc(TaxonNodeStatus.class);
132 }
133
134 @Override
135 public String getKey(){return delegateVocTerm.getKey();}
136
137 @Override
138 public String getLabel(){return delegateVocTerm.getLabel();}
139
140 @Override
141 public String getLabel(Language language){return delegateVocTerm.getLabel(language);}
142
143 @Override
144 public UUID getUuid() {return delegateVocTerm.getUuid();}
145
146 @Override
147 public TaxonNodeStatus getKindOf() {return delegateVocTerm.getKindOf();}
148
149 @Override
150 public Set<TaxonNodeStatus> getGeneralizationOf() {return delegateVocTerm.getGeneralizationOf();}
151
152 @Override
153 public boolean isKindOf(TaxonNodeStatus ancestor) {return delegateVocTerm.isKindOf(ancestor); }
154
155 @Override
156 public Set<TaxonNodeStatus> getGeneralizationOf(boolean recursive) {return delegateVocTerm.getGeneralizationOf(recursive);}
157
158 public static TaxonNodeStatus getByKey(String key){return delegateVoc.getByKey(key);}
159 public static TaxonNodeStatus getByUuid(UUID uuid) {return delegateVoc.getByUuid(uuid);}
160
161 //**************** symbol **********************/
162
163 public String getSymbol(){
164 return symbol;
165 }
166 }