Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
12   98   13   1.33
8   41   1.08   9
9     1.44  
1    
 
  AuthorVo       Line # 28 12 13 100% 1.0
 
  (101)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, 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.se.dto.module;
17   
18    import org.qedeq.base.utility.EqualsUtility;
19    import org.qedeq.kernel.se.base.module.Author;
20    import org.qedeq.kernel.se.base.module.Latex;
21   
22   
23    /**
24    * Describes a QEDEQ module author.
25    *
26    * @author Michael Meyling
27    */
 
28    public class AuthorVo implements Author {
29   
30    /** Author name. */
31    private Latex name;
32   
33    /** Email address of author. */
34    private String email;
35   
36    /**
37    * Constructs an author.
38    *
39    * @param name Author name.
40    * @param email Author's email address.
41    */
 
42  597 toggle public AuthorVo(final LatexVo name, final String email) {
43  597 this.name = name;
44  597 this.email = email;
45    }
46   
47    /**
48    * Constructs an empty author.
49    */
 
50  652 toggle public AuthorVo() {
51    // nothing to do
52    }
53   
54    /**
55    * Set name of author.
56    *
57    * @param name Author name.
58    */
 
59  638 toggle public final void setName(final LatexVo name) {
60  638 this.name = name;
61    }
62   
 
63  5204 toggle public final Latex getName() {
64  5204 return name;
65    }
66   
67    /**
68    * Set author's email address.
69    *
70    * @param email Email address.
71    */
 
72  637 toggle public final void setEmail(final String email) {
73  637 this.email = email;
74    }
75   
 
76  2153 toggle public final String getEmail() {
77  2153 return email;
78    }
79   
 
80  111 toggle public boolean equals(final Object obj) {
81  111 if (!(obj instanceof AuthorVo)) {
82  5 return false;
83    }
84  106 final AuthorVo other = (AuthorVo) obj;
85  106 return EqualsUtility.equals(getName(), other.getName())
86    && EqualsUtility.equals(getEmail(), other.getEmail());
87    }
88   
 
89  137 toggle public int hashCode() {
90  137 return (getName() != null ? getName().hashCode() : 0)
91  137 ^ (getEmail() != null ? 1 ^ getEmail().hashCode() : 0);
92    }
93   
 
94  90 toggle public String toString() {
95  90 return getName() + (getEmail() != null ? "<" + getEmail() + ">" : "");
96    }
97   
98    }