PresenceAbsenceTerms added
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / description / PresenceTerm.java
1 /**
2 * Copyright (C) 2007 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
10 package eu.etaxonomy.cdm.model.description;
11
12 import java.util.UUID;
13
14 import org.apache.log4j.Logger;
15
16 import eu.etaxonomy.cdm.model.common.Language;
17 import eu.etaxonomy.cdm.model.location.Continent;
18 import eu.etaxonomy.cdm.model.location.NamedArea;
19 import eu.etaxonomy.cdm.model.taxon.Taxon;
20
21 import javax.persistence.*;
22 import javax.xml.bind.annotation.XmlAccessType;
23 import javax.xml.bind.annotation.XmlAccessorType;
24 import javax.xml.bind.annotation.XmlRootElement;
25 import javax.xml.bind.annotation.XmlType;
26
27 /**
28 * This class represents terms describing different types of presence
29 * (like "native" or "introduced") of a {@link Taxon taxon} in a {@link NamedArea particular area}.
30 *
31 * @author m.doering
32 * @version 1.0
33 * @created 08-Nov-2007 13:06:44
34 */
35 @XmlAccessorType(XmlAccessType.FIELD)
36 @XmlType(name = "PresenceTerm")
37 @XmlRootElement(name = "PresenceTerm")
38 @Entity
39 public class PresenceTerm extends PresenceAbsenceTermBase<PresenceTerm> {
40 private static final Logger logger = Logger.getLogger(PresenceTerm.class);
41
42 //********* METHODS **************************************/
43 /**
44 * Creates a new empty presence term.
45 *
46 * @see #NewInstance(String, String, String)
47 */
48 public static PresenceTerm NewInstance(){
49 return new PresenceTerm();
50 }
51
52 /**
53 * Creates a new presence term with a description (in the {@link Language#DEFAULT() default language}),
54 * a label and a label abbreviation.
55 *
56 * @param term the string (in the default language) describing the
57 * new presence term to be created
58 * @param label the string identifying the new presence term to be created
59 * @param labelAbbrev the string identifying (in abbreviated form) the
60 * new presence term to be created
61 * @see #NewInstance()
62 */
63 public static PresenceTerm NewInstance(String term, String label, String labelAbbrev){
64 return new PresenceTerm(term, label, labelAbbrev);
65 }
66
67 // ************* CONSTRUCTORS *************/
68 /**
69 * Class constructor: creates a new empty presence term.
70 *
71 * @see #PresenceTerm(String, String, String)
72 */
73 public PresenceTerm() {
74 super();
75 }
76
77 /**
78 * Class constructor: creates a new presence term with a description (in the {@link Language#DEFAULT() default language}),
79 * a label and a label abbreviation.
80 *
81 * @param term the string (in the default language) describing the
82 * new presence term to be created
83 * @param label the string identifying the new presence term to be created
84 * @param labelAbbrev the string identifying (in abbreviated form) the
85 * new presence term to be created
86 * @see #PresenceTerm()
87 */
88 public PresenceTerm(String term, String label, String labelAbbrev) {
89 super(term, label, labelAbbrev);
90 }
91
92 private static final UUID uuidP=UUID.fromString("cef81d25-501c-48d8-bbea-542ec50de2c2");
93 private static final UUID uuidN=UUID.fromString("ddeac4f2-d8fa-43b8-ad7e-ca13abdd32c7");
94 private static final UUID uuidNQ=UUID.fromString("925662c1-bb10-459a-8c53-da5a738ac770");
95 private static final UUID uuidNE=UUID.fromString("8ad9e9df-49cd-4b6a-880b-51ec4de4ce32");
96 private static final UUID uuidND=UUID.fromString("310373bf-7df4-4d02-8cb3-bcc7448805fc");
97 private static final UUID uuidNF=UUID.fromString("4ba212ef-041e-418d-9d43-2ebb191b61d8");
98 private static final UUID uuidC=UUID.fromString("9eb99fe6-59e2-4445-8e6a-478365bd0fa9");
99 private static final UUID uuidCF=UUID.fromString("b47f1679-0d0c-4ea7-a2e4-80709ea791c6");
100 private static final UUID uuidI=UUID.fromString("643cf9d1-a5f1-4622-9837-82ef961e880b");
101 private static final UUID uuidIQ=UUID.fromString("83eb0aa0-1a45-495a-a3ca-bf6958b74366");
102 private static final UUID uuidIE=UUID.fromString("2522c527-e488-45d4-87df-a5a5ef0fdbbd");
103 private static final UUID uuidID=UUID.fromString("0c54761e-4887-4788-9dfa-7190c88746e3");
104 private static final UUID uuidIP=UUID.fromString("da159544-b0dd-4599-a9c9-640826af8c17");
105 private static final UUID uuidIA=UUID.fromString("42946bd6-9c22-45ad-a910-7427e8f60bfd");
106 private static final UUID uuidIN=UUID.fromString("e191e89a-a751-4b0c-b883-7f1de70915c9");
107 private static final UUID uuidIF=UUID.fromString("826239f7-45b7-42b5-857c-c1f852cfad6b");
108 private static final UUID uuidE=UUID.fromString("c3ee7048-15b7-4be1-b687-9ce9c1a669d6");
109
110
111
112 public static final PresenceTerm getByUuid(UUID uuid){
113 return (PresenceTerm)findByUuid(uuid);
114 }
115
116
117 //TODO Marc: Kannst du die noch ein bischen schöner formatieren, wenn du sie dokumentierst? Danke
118 public static final PresenceTerm PRESENT(){return getByUuid(uuidP);}
119 public static final PresenceTerm NATIVE(){return getByUuid(uuidN);}
120 public static final PresenceTerm NATIVE_PRESENCE_QUESTIONABLE(){return getByUuid(uuidNQ);}
121 public static final PresenceTerm NATIVE_FORMERLY_NATIVE(){return getByUuid(uuidNE);}
122 public static final PresenceTerm NATIVE_DOUBTFULLY_NATIVE(){return getByUuid(uuidND);}
123 public static final PresenceTerm NATIVE_REPORTED_IN_ERROR(){return getByUuid(uuidNF);}
124 public static final PresenceTerm CULTIVATED(){return getByUuid(uuidC);}
125 public static final PresenceTerm CULTIVATED_REPORTED_IN_ERROR(){return getByUuid(uuidCF);}
126 public static final PresenceTerm INTRODUCED(){return getByUuid(uuidI);}
127 public static final PresenceTerm INTRODUCED_PRESENCE_QUESTIONABLE(){return getByUuid(uuidIQ);}
128 public static final PresenceTerm INTRODUCED_FORMERLY_INTRODUCED(){return getByUuid(uuidIE);}
129 public static final PresenceTerm INTRODUCED_DOUBTFULLY_INTRODUCED(){return getByUuid(uuidID);}
130 public static final PresenceTerm INTRODUCED_UNCERTAIN_DEGREE_OF_NATURALISATION(){return getByUuid(uuidIP);}
131 public static final PresenceTerm INTRODUCED_ADVENTITIOUS(){return getByUuid(uuidIA);}
132 public static final PresenceTerm INTRODUCED_NATURALIZED(){return getByUuid(uuidIN);}
133 public static final PresenceTerm INTRODUCED_REPORTED_IN_ERROR(){return getByUuid(uuidIF);}
134 public static final PresenceTerm ENDEMIC_FOR_THE_RELEVANT_AREA(){return getByUuid(uuidE);}
135 }