fix #7915 move datePublished to subinterface IWithAuthorAndDate, remove from IJournal...
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / reference / IWithAuthorAndDate.java
1 /**
2 * Copyright (C) 2018 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.reference;
10
11 import javax.persistence.Transient;
12
13 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
14 import eu.etaxonomy.cdm.model.common.TimePeriod;
15 import eu.etaxonomy.cdm.model.common.VerbatimTimePeriod;
16
17 /**
18 * Interface representing all {@link Reference references} which have
19 * a {@link Reference#getType() type} allowing an authorship and
20 * a single publication date.
21 * @author a.mueller
22 * @since 20.11.2018
23 *
24 */
25 public interface IWithAuthorAndDate {
26
27 /**
28 * Returns the references author(s)
29 */
30 public TeamOrPersonBase getAuthorship();
31
32 /**
33 * Sets the references author(s)
34 */
35 public void setAuthorship(TeamOrPersonBase authorship);
36
37
38
39 /**
40 * Returns the date when the reference was published as a {@link TimePeriod}
41 */
42 public VerbatimTimePeriod getDatePublished();
43
44 /**
45 * Sets the date when the reference was published.
46 */
47 public void setDatePublished(VerbatimTimePeriod datePublished);
48
49
50 /**
51 * Sets the date when the reference was published.
52 * <BR>
53 * Note: The time period will be internally converted to
54 * a VerbatimTimePeriod so later changes to it will not
55 * be reflected in the reference time period.
56 * @return the new converted VerbatimTimePeriod
57 * @param datePublished the not yet converted TimePeriod
58 * @deprecated only for compatibility with older versions
59 * but may create problems in certain contexts therefore
60 * will be removed soon.
61 */
62 @Transient
63 @Deprecated
64 public VerbatimTimePeriod setDatePublished(TimePeriod datePublished);
65 }