Project

General

Profile

« Previous | Next » 

Revision 63228380

Added by Andreas Müller almost 9 years ago

more getters/adders, update script, vocabulary and test vocabulary for TaxonNodeAgentRelation #3583

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/VocabularyEnum.java
1 1
// $Id$
2 2
/**
3 3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
4
* European Distributed Institute of Taxonomy
5 5
* http://www.e-taxonomy.eu
6
* 
6
*
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
......
38 38
/**
39 39
 * @author n.hoffmann
40 40
 * @created 03.06.2009
41
 * 
41
 *
42 42
 * @deprecated
43 43
 * A static list of vocabularies is not the right way to do this.
44 44
 * We will use a service method that will return vocabularies by term type (once that is implemented)
45 45
 */
46
@Deprecated 
46
@Deprecated
47 47
public enum VocabularyEnum {
48 48

  
49 49
	Language("45ac7043-7f5e-4f37-92f2-3874aaaef2de", Language.class),
......
91 91
	SpecimenKindOfUnit("b0344ec4-12f7-40d3-82c1-0092e9780bbd", DefinedTerm.class),
92 92
	MediaSpecimenKindOfUnit("56f47c83-8d42-404a-88fc-03c57b560f6d", DefinedTerm.class),
93 93
	IdentifierType("67d91839-484e-4183-8b4c-6a4a80dfc066", DefinedTerm.class),
94
	DnaQualityType("55746f7b-78a8-4e5f-8e70-ee9ce047c835", OrderedTerm.class)
94
	DnaQualityType("55746f7b-78a8-4e5f-8e70-ee9ce047c835", OrderedTerm.class),
95
	TaxonNodeAgentRelationType("0aa8e0c6-c7b5-42dd-91b7-0bd273a64b2c", DefinedTerm.class)
95 96
	;
96
	 
97
	
97

  
98

  
98 99
	private UUID uuid;
99 100
	private Class<? extends DefinedTermBase<?>> clazz;
100
	
101

  
101 102
	private VocabularyEnum(String uuidString, Class<? extends DefinedTermBase<?>> clazz){
102 103
		this.uuid = UUID.fromString(uuidString);
103 104
		this.clazz = clazz;
104 105
	}
105
	
106
	/** 
106

  
107
	/**
107 108
	 * @return the <code>UUID</code> this vocabulary is uniquely identified with
108 109
	 */
109 110
	public UUID getUuid(){
110 111
		return uuid;
111 112
	}
112
	
113

  
113 114
	/**
114 115
	 * @return the Class of a specific term vocabulary
115 116
	 */
116 117
	public Class<? extends DefinedTermBase<?>> getClazz(){
117 118
		return clazz;
118 119
	}
119
	
120

  
120 121
	public static VocabularyEnum getVocabularyEnum(Class<?> clazz){
121
		
122

  
122 123
		for(VocabularyEnum vocabulary : VocabularyEnum.values()){
123 124
			if(vocabulary.getClazz().equals(clazz)){
124 125
				return vocabulary;
125 126
			}
126 127
		}
127
		
128

  
128 129
		return null;
129 130
	}
130 131
}

Also available in: Unified diff