use strings for recordBasis (#2615 und #3544)
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / common / ISimpleTerm.java
1 /**
2 *
3 */
4 package eu.etaxonomy.cdm.model.common;
5
6 import java.util.Set;
7 import java.util.UUID;
8
9 import javax.persistence.Transient;
10
11 /**
12 * The common interface which is implemented by {@link DefinedTermBase defined terms} and enumerations
13 * replacing fully {@link DefinedTermBase defined terms}.
14 *
15 * @author a.mueller
16 * @created 14-Jul-1913
17 */
18 public interface ISimpleTerm<T extends ISimpleTerm> {
19
20 @Transient
21 public UUID getUuid();
22
23 //is static !!
24 // public T getByUuid(UUID uuid);
25
26
27 /**
28 * Returns the defined term this term is a kind of.
29 * Therefore the returned term is a generalization of <code>this</code> term
30 */
31 public T getKindOf();
32
33
34 /**
35 * Returns all defined terms this term is a direct generalization for.
36 * Therefore the returned terms are kind of <code>this</code> term.
37 */
38 public Set<T> getGeneralizationOf();
39
40
41 /**
42 * Computes if <code>this</code> term is kind of the <code>ancestor</code> term.
43 * So the <code>ancestor</code> term is direct or indirect (recursive) generalization
44 * of <code>this</code> term.
45 * @param ancestor the potential ancestor term
46 * @see #getKindOf()
47 * @see #getGeneralizationOf()
48 */
49 public boolean isKindOf(T ancestor);
50
51 /**
52 * Returns all defined terms this term is a generalization for.
53 * Therefore the returned terms are kind of <code>this</code> term.
54 * If parameter <code>recursive</code> is <code>false</code> only the
55 * direct descendants will be returned. If it is <code>true</code>
56 * the direct descendants and there recursive descendants (all descendants)
57 * will be returned.
58 */
59 //TODO move up to ISimpleTerm
60 public Set<T> getGeneralizationOf(boolean recursive);
61
62 }