3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.model
;
13 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
14 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
15 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
18 * <p>AuthorHelper class.</p>
21 * @created Sep 8, 2010
24 public class AuthorHelper
{
29 * @param object a {@link java.lang.Object} object.
30 * @return a {@link eu.etaxonomy.cdm.model.agent.Team} object.
32 public static Team
getAuthor(Object object
){
36 Object deproxiedObject
= HibernateProxyHelper
.deproxy(object
);
37 if(deproxiedObject
instanceof Person
){
38 Person person
= (Person
) deproxiedObject
;
39 Team team
= Team
.NewInstance();
40 team
.addTeamMember(person
);
43 else if(deproxiedObject
instanceof Team
){
44 return (Team
) deproxiedObject
;
46 throw new IllegalArgumentException("Given object os of the wrong type");