1 |
1c39686b
|
Andreas Müller
|
/**
|
2 |
|
|
*
|
3 |
|
|
*/
|
4 |
|
|
package eu.etaxonomy.cdm.model.term;
|
5 |
|
|
|
6 |
|
|
import eu.etaxonomy.cdm.model.common.Language;
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
|
|
* Interface for all enumerations which provide a key for persisting them as strings
|
10 |
|
|
* via {@link EnumUserType}.
|
11 |
|
|
* The key may also be used for other purposes.
|
12 |
|
|
* The key must be unique within the enumeration.
|
13 |
|
|
*
|
14 |
|
|
* The interface also provides a human readable representation with i18n support.
|
15 |
|
|
*
|
16 |
|
|
* IMPORTANT: classes implementing this interface must also implement a static method
|
17 |
|
|
* <code>getByKey(String)</code> which returns the according instance. This can not be
|
18 |
|
|
* guaranteed by the interface as interfaces do not allow definitions of static methods.
|
19 |
|
|
*
|
20 |
|
|
* @author a.mueller
|
21 |
|
|
* @since 30-Aug-2013
|
22 |
|
|
*
|
23 |
|
|
*/
|
24 |
|
|
public interface IKeyTerm {
|
25 |
|
|
|
26 |
|
|
/**
|
27 |
|
|
* Returns the key for the enumeration.
|
28 |
|
|
* A key should be short unique identifier within the given enumeration.
|
29 |
|
|
* If not otherwise stated it should not be longer then 3 characters.
|
30 |
|
|
* @return the key
|
31 |
|
|
*/
|
32 |
|
|
public String getKey();
|
33 |
|
|
|
34 |
|
|
/**
|
35 |
|
|
* Returns a human readable preferably for the default language.
|
36 |
|
|
* @return
|
37 |
|
|
*/
|
38 |
|
|
public String getMessage();
|
39 |
|
|
|
40 |
|
|
/**
|
41 |
|
|
* Returns a human readable preferably for the given language.
|
42 |
|
|
* @param language
|
43 |
|
|
* @return
|
44 |
|
|
*/
|
45 |
|
|
public String getMessage(Language language);
|
46 |
|
|
|
47 |
|
|
}
|