Project

General

Profile

Download (5.35 KB) Statistics
| Branch: | Tag: | Revision:
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.List;
13
import java.util.Set;
14

    
15
import eu.etaxonomy.cdm.model.media.Rights;
16

    
17
public interface IIdentifiableEntity extends ISourceable<IdentifiableSource>, IAnnotatableEntity{
18

    
19
    public LSID getLsid();
20

    
21
    public void setLsid(LSID lsid);
22

    
23
    public String generateTitle();
24

    
25
    public String getTitleCache();
26

    
27
    /**
28
     * Sets the title cache without changing the <code>protectCache</code> flag.<BR><BR>
29
     * NOTE: Use with care. If this flag is <code>false</code> the <code>titleCache</code> may be
30
     * recomputed with the next call of {@link #getTitleCache()}, which is automatically the case when
31
     * the object is persisted.
32
     * @see #setTitleCache(String, boolean)
33
     * @see #getTitleCache()
34
     * @param titleCache
35
     * @deprecated this method only exists to be in line with the Java Beans Specification (JSR 220 or JSR 273) .
36
     * As it will set the {@link #isProtectedTitleCache() protected} flag to false the title cache value
37
     * may be automatically recomputed later. There are only very rare use cases were a programmer may
38
     * want to use this method directly.
39
     * Better use {@link #setTitleCache(String, boolean)} with second parameter <code>protectCache</code>
40
     * set to <code>true</code>.
41
     */
42
    @Deprecated
43
    public void setTitleCache(String titleCache);
44

    
45
    /**
46
     * Sets the title cache.<BR>
47
     * NOTE: In most cases the <code>protectCache</code> argument should be set to <code>true</code>.
48
     * See comments at {@link #setTitleCache(String)}
49
     *
50
     * @param titleCache the new title cache
51
     * @param protectCache the protect flag, <b>should in most cases be set to <code>true</code></b>
52
     */
53
    public void setTitleCache(String titleCache, boolean protectCache);
54

    
55
    public boolean isProtectedTitleCache();
56

    
57
    public void setProtectedTitleCache(boolean protectedTitleCache);
58

    
59
    public Set<Rights> getRights();
60

    
61
    public void addRights(Rights right);
62

    
63
    public void removeRights(Rights right);
64

    
65
    public List<Credit> getCredits();
66

    
67
    public Credit getCredits(Integer index);
68

    
69
    public void addCredit(Credit credig);
70

    
71
    public void addCredit(Credit credit, int index);
72

    
73
    public void removeCredit(Credit credit);
74

    
75
    public void removeCredit(int index);
76

    
77
    public Set<Extension> getExtensions();
78

    
79
    public void addExtension(Extension extension);
80

    
81
    public void removeExtension(Extension extension);
82

    
83
    /**
84
     * Returns the list of {@link Identifier alternative identifiers}.
85
     * In case the order of these identifiers is important it should be
86
     * implemented such that the first item in the list is the most 
87
     * important/most current identifier. <BR>
88
     * E.g. if a barcode identifier
89
     * is more important than the accession number for a certain 
90
     * specimen, than the barcode identifier should be before the accession number.
91
     * <BR>Or if a sample designation is the most recent of all sample designations
92
     * than it should be the first in the list while all history designations come
93
     * later.
94
     * @return
95
     */
96
    public List<Identifier> getIdentifiers();
97

    
98
    /**
99
     * Create and add a new identifier.
100
     * @see #getIdentifiers()
101
     * @param identifier
102
     * @param identifierType
103
     * @return
104
     */
105
    public Identifier addIdentifier(String identifier, DefinedTerm identifierType);
106
    
107
    /**
108
     * @see #getIdentifiers()
109
     * @param identifier
110
     */
111
    public void addIdentifier(Identifier identifier);
112
    
113
    /**
114
     * Adds an identifier at the given position. For use of 
115
     * <code>index</code> see {@link List#add(int, Object)} and {@link#getIdentifiers()}
116
     * @see #getIdentifiers()
117
     * @param index the list index 
118
     * @param identifier the identifier
119
     */
120
    public void addIdentifier(int index, Identifier identifier);
121

    
122
    /**
123
     * Removes an identifier at the given position. For use of 
124
     * <code>index</code> see {@link List#add(int, Object)} and {@link#getIdentifiers()}
125
     * @param index the list index 
126
     */
127
    public void removeIdentifier(int index);
128

    
129
    
130
    /**
131
     * Removes an identifier
132
     * @see #getIdentifiers()
133
     * @param identifier
134
     */
135
    public void removeIdentifier(Identifier identifier);
136

    
137

    
138
    /**
139
     * Overrides {@link eu.etaxonomy.cdm.model.common.CdmBase#toString()}.
140
     * This returns an String that identifies the object well without beeing necessarily unique.
141
     * Specification: This method should never call other object' methods so it can be well used for debugging
142
     * without problems like lazy loading, unreal states etc.
143
     * Note: If overriding this method's javadoc always copy or link the above requirement.
144
     * If not overwritten by a subclass method returns the class, id and uuid as a string for any CDM object.
145
     * For example: Taxon#13<b5938a98-c1de-4dda-b040-d5cc5bfb3bc0>
146
     * @see java.lang.Object#toString()
147
     */
148
    @Override
149
    public String toString();
150

    
151
    public byte[] getData();
152

    
153
	void removeSources();
154

    
155
}
(20-20/72)