Revision 11d042b5
Added by Patrick Plitzner over 9 years ago
- added java doc
- specified method parameter
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AuthorHelper.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
13 | 13 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
14 | 14 |
import eu.etaxonomy.cdm.model.agent.Person; |
15 | 15 |
import eu.etaxonomy.cdm.model.agent.Team; |
16 |
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase; |
|
16 | 17 |
|
17 | 18 |
/** |
18 |
* <p>AuthorHelper class.</p>
|
|
19 |
* Utility class for handling of authorship related elements.
|
|
19 | 20 |
* |
20 | 21 |
* @author n.hoffmann |
21 | 22 |
* @created Sep 8, 2010 |
22 | 23 |
* @version 1.0 |
23 | 24 |
*/ |
24 | 25 |
public class AuthorHelper { |
25 |
|
|
26 |
/** |
|
27 |
* <p>getAuthor</p> |
|
28 |
* |
|
29 |
* @param object a {@link java.lang.Object} object. |
|
30 |
* @return a {@link eu.etaxonomy.cdm.model.agent.Team} object. |
|
31 |
*/ |
|
32 |
public static Team getAuthor(Object object){ |
|
33 |
if(object == null){ |
|
26 |
|
|
27 |
/** |
|
28 |
* If the given {@link TeamOrPersonBase} is a {@link Person} this methods |
|
29 |
* creates a new {@link Team} with this person. If it already a team the |
|
30 |
* team is returned. |
|
31 |
* |
|
32 |
* @param teamOrPerson |
|
33 |
* a team or a person |
|
34 |
* @return the given team or a newly created team with the given person |
|
35 |
*/ |
|
36 |
public static Team getAuthor(TeamOrPersonBase<?> teamOrPerson){ |
|
37 |
if(teamOrPerson == null){ |
|
34 | 38 |
return null; |
35 | 39 |
} |
36 |
Object deproxiedObject = HibernateProxyHelper.deproxy(object);
|
|
40 |
Object deproxiedObject = HibernateProxyHelper.deproxy(teamOrPerson);
|
|
37 | 41 |
if(deproxiedObject instanceof Person){ |
38 | 42 |
Person person = (Person) deproxiedObject; |
39 | 43 |
Team team = Team.NewInstance(); |
Also available in: Unified diff