Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
12   101   10   1,33
8   41   0,83   9
9     1,11  
1    
 
  AuthorVo       Line # 31 12 10 100% 1.0
 
  (40)
 
1    /* $Id: AuthorVo.java,v 1.9 2008/07/26 07:59:35 m31 Exp $
2    *
3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
4    *
5    * Copyright 2000-2008, Michael Meyling <mime@qedeq.org>.
6    *
7    * "Hilbert II" is free software; you can redistribute
8    * it and/or modify it under the terms of the GNU General Public
9    * License as published by the Free Software Foundation; either
10    * version 2 of the License, or (at your option) any later version.
11    *
12    * This program is distributed in the hope that it will be useful,
13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15    * GNU General Public License for more details.
16    */
17   
18    package org.qedeq.kernel.dto.module;
19   
20    import org.qedeq.base.utility.EqualsUtility;
21    import org.qedeq.kernel.base.module.Author;
22    import org.qedeq.kernel.base.module.Latex;
23   
24   
25    /**
26    * Describes a QEDEQ module author.
27    *
28    * @version $Revision: 1.9 $
29    * @author Michael Meyling
30    */
 
31    public class AuthorVo implements Author {
32   
33    /** Author name. */
34    private Latex name;
35   
36    /** Email address of author. */
37    private String email;
38   
39    /**
40    * Constructs an author.
41    *
42    * @param name Author name.
43    * @param email Author's email address.
44    */
 
45  133 toggle public AuthorVo(final LatexVo name, final String email) {
46  133 this.name = name;
47  133 this.email = email;
48    }
49   
50    /**
51    * Constructs an empty author.
52    */
 
53  188 toggle public AuthorVo() {
54    // nothing to do
55    }
56   
57    /**
58    * Set name of author.
59    *
60    * @param name Author name.
61    */
 
62  175 toggle public final void setName(final LatexVo name) {
63  175 this.name = name;
64    }
65   
 
66  1582 toggle public final Latex getName() {
67  1582 return name;
68    }
69   
70    /**
71    * Set author's email address.
72    *
73    * @param email Email address.
74    */
 
75  175 toggle public final void setEmail(final String email) {
76  175 this.email = email;
77    }
78   
 
79  740 toggle public final String getEmail() {
80  740 return email;
81    }
82   
 
83  106 toggle public boolean equals(final Object obj) {
84  106 if (!(obj instanceof AuthorVo)) {
85  5 return false;
86    }
87  101 final AuthorVo other = (AuthorVo) obj;
88  101 return EqualsUtility.equals(getName(), other.getName())
89    && EqualsUtility.equals(getEmail(), other.getEmail());
90    }
91   
 
92  103 toggle public int hashCode() {
93  103 return (getName() != null ? getName().hashCode() : 0)
94  103 ^ (getEmail() != null ? 1 ^ getEmail().hashCode() : 0);
95    }
96   
 
97  62 toggle public String toString() {
98  62 return getName() + (getEmail() != null ? "<" + getEmail() + ">" : "");
99    }
100   
101    }