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
|
package eu.etaxonomy.cdm.model.molecular;
|
10
|
|
11
|
import java.util.UUID;
|
12
|
|
13
|
import eu.etaxonomy.cdm.model.common.IKeyTerm;
|
14
|
import eu.etaxonomy.cdm.model.common.Language;
|
15
|
|
16
|
/**
|
17
|
* A Sequence Direction defines the direction in which a DNA part was read by a {@link Primer}
|
18
|
* for a {@link SingleRead sequencing process}.
|
19
|
* This can be either {@link #Forward} or {@link #Reverse}.
|
20
|
*
|
21
|
* @author a.mueller
|
22
|
* @since 2013-07-11
|
23
|
*/
|
24
|
public enum SequenceDirection implements IKeyTerm {
|
25
|
Forward("e611de24-09bf-468f-b6ee-e34124022912", "Forward", "FWD"),
|
26
|
Reverse("d116fb2c-00e7-46a4-86b4-74c46ca2afa0", "Reverse", "REV")
|
27
|
;
|
28
|
|
29
|
private UUID uuid;
|
30
|
private String key;
|
31
|
private String message;
|
32
|
// private static Map<String,SequenceDirection> keyMap = new HashMap<String, SequenceDirection>();
|
33
|
|
34
|
private SequenceDirection(String uuidString, String defaultMessage, String key){
|
35
|
uuid = UUID.fromString(uuidString);
|
36
|
this.key = key;
|
37
|
// keyMap.put(key, this);
|
38
|
}
|
39
|
|
40
|
public UUID getUuid() {
|
41
|
return uuid;
|
42
|
}
|
43
|
|
44
|
public String getKey() {
|
45
|
return key;
|
46
|
}
|
47
|
|
48
|
|
49
|
@Override
|
50
|
public String getMessage() {
|
51
|
return message;
|
52
|
}
|
53
|
|
54
|
@Override
|
55
|
public String getMessage(Language language) {
|
56
|
//TODO support i18n
|
57
|
return message;
|
58
|
}
|
59
|
|
60
|
public static IKeyTerm getByKey(String val) {
|
61
|
for (SequenceDirection dir : SequenceDirection.values()){
|
62
|
if (dir.key.equals(val)){
|
63
|
return dir;
|
64
|
}
|
65
|
}
|
66
|
return null;
|
67
|
}
|
68
|
|
69
|
}
|