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.common;
|
11
|
|
12
|
import java.util.Set;
|
13
|
import java.util.UUID;
|
14
|
|
15
|
import javax.xml.bind.annotation.XmlEnum;
|
16
|
import javax.xml.bind.annotation.XmlEnumValue;
|
17
|
|
18
|
import org.apache.log4j.Logger;
|
19
|
|
20
|
import eu.etaxonomy.cdm.model.term.EnumeratedTermVoc;
|
21
|
import eu.etaxonomy.cdm.model.term.IEnumTerm;
|
22
|
|
23
|
|
24
|
/**
|
25
|
* The type of authority for an externally loaded entity.
|
26
|
*
|
27
|
* @author a.mueller
|
28
|
* @since 21.09.2017
|
29
|
*/
|
30
|
@XmlEnum
|
31
|
public enum AuthorityType implements IEnumTerm<AuthorityType>{
|
32
|
|
33
|
/**
|
34
|
* The entity is managed externally.
|
35
|
*/
|
36
|
@XmlEnumValue("Extern")
|
37
|
EXTERN(UUID.fromString("9a20f0ac-fe97-4b88-aa08-8d34a6d99359"), "Extern", "EXT", null),
|
38
|
|
39
|
//0
|
40
|
/**
|
41
|
* The entity has been imported from an external source but is now
|
42
|
* managed locally. However, the link to the external source is
|
43
|
* still important e.g. to compare the 2 versions.
|
44
|
*/
|
45
|
@XmlEnumValue("Local")
|
46
|
LOCAL(UUID.fromString("47a38db6-b8b0-4fd5-8752-677408fba4f8"), "Local", "LOC", null),
|
47
|
|
48
|
;
|
49
|
|
50
|
@SuppressWarnings("unused")
|
51
|
private static final Logger logger = Logger.getLogger(AuthorityType.class);
|
52
|
|
53
|
|
54
|
private AuthorityType(UUID uuid, String defaultString, String key, AuthorityType parent){
|
55
|
delegateVocTerm = EnumeratedTermVoc.addTerm(getClass(), this, uuid, defaultString, key, parent);
|
56
|
}
|
57
|
|
58
|
// *************************** DELEGATE **************************************/
|
59
|
|
60
|
private static EnumeratedTermVoc<AuthorityType> delegateVoc;
|
61
|
private IEnumTerm<AuthorityType> delegateVocTerm;
|
62
|
|
63
|
static {
|
64
|
delegateVoc = EnumeratedTermVoc.getVoc(AuthorityType.class);
|
65
|
}
|
66
|
|
67
|
@Override
|
68
|
public String getKey(){return delegateVocTerm.getKey();}
|
69
|
|
70
|
@Override
|
71
|
public String getLabel(){return delegateVocTerm.getLabel();}
|
72
|
|
73
|
@Override
|
74
|
public String getLabel(Language language){return delegateVocTerm.getLabel(language);}
|
75
|
|
76
|
@Override
|
77
|
public UUID getUuid() {return delegateVocTerm.getUuid();}
|
78
|
|
79
|
@Override
|
80
|
public AuthorityType getKindOf() {return delegateVocTerm.getKindOf();}
|
81
|
|
82
|
@Override
|
83
|
public Set<AuthorityType> getGeneralizationOf() {return delegateVocTerm.getGeneralizationOf();}
|
84
|
|
85
|
@Override
|
86
|
public boolean isKindOf(AuthorityType ancestor) {return delegateVocTerm.isKindOf(ancestor); }
|
87
|
|
88
|
@Override
|
89
|
public Set<AuthorityType> getGeneralizationOf(boolean recursive) {return delegateVocTerm.getGeneralizationOf(recursive);}
|
90
|
|
91
|
public static AuthorityType getByKey(String key){return delegateVoc.getByKey(key);}
|
92
|
public static AuthorityType getByUuid(UUID uuid) {return delegateVoc.getByUuid(uuid);}
|
93
|
|
94
|
|
95
|
}
|