- added java doc
authorPatric Plitzner <p.plitzner@bgbm.org>
Tue, 14 Oct 2014 07:24:16 +0000 (07:24 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Tue, 14 Oct 2014 07:24:16 +0000 (07:24 +0000)
 - specified method parameter

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AuthorHelper.java

index aa8979b1ba884fc4c69277880b2b42ec227937f6..6884ba88c5194e85fa9fb56b7c1a4f72e38a786a 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -13,27 +13,31 @@ package eu.etaxonomy.taxeditor.model;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 
 /**
- * <p>AuthorHelper class.</p>
+ * Utility class for handling of authorship related elements.
  *
  * @author n.hoffmann
  * @created Sep 8, 2010
  * @version 1.0
  */
 public class AuthorHelper {
-       
-       /**
-        * <p>getAuthor</p>
-        *
-        * @param object a {@link java.lang.Object} object.
-        * @return a {@link eu.etaxonomy.cdm.model.agent.Team} object.
-        */
-       public static Team getAuthor(Object object){
-               if(object == null){
+
+    /**
+     * If the given {@link TeamOrPersonBase} is a {@link Person} this methods
+     * creates a new {@link Team} with this person. If it already a team the
+     * team is returned.
+     * 
+     * @param teamOrPerson
+     *            a team or a person
+     * @return the given team or a newly created team with the given person
+     */
+       public static Team getAuthor(TeamOrPersonBase<?> teamOrPerson){
+               if(teamOrPerson == null){
                        return null;
                }
-               Object deproxiedObject = HibernateProxyHelper.deproxy(object);
+               Object deproxiedObject = HibernateProxyHelper.deproxy(teamOrPerson);
                if(deproxiedObject instanceof Person){
                        Person person = (Person) deproxiedObject;
                        Team team = Team.NewInstance();