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