Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Mai 10 2007 03:16:40 CEST
file stats: LOC: 101   Methods: 9
NCLOC: 41   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
AuthorVo.java 100% 100% 100% 100%
coverage
 1    /* $Id: AuthorVo.java,v 1.7 2007/05/10 00:37:50 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2007, 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.kernel.base.module.Author;
 21    import org.qedeq.kernel.base.module.Latex;
 22    import org.qedeq.kernel.utility.EqualsUtility;
 23   
 24   
 25    /**
 26    * Describes a QEDEQ module author.
 27    *
 28    * @version $Revision: 1.7 $
 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  41 public AuthorVo(final LatexVo name, final String email) {
 46  41 this.name = name;
 47  41 this.email = email;
 48    }
 49   
 50    /**
 51    * Constructs an empty author.
 52    */
 53  104 public AuthorVo() {
 54    // nothing to do
 55    }
 56   
 57    /**
 58    * Set name of author.
 59    *
 60    * @param name Author name.
 61    */
 62  91 public final void setName(final LatexVo name) {
 63  91 this.name = name;
 64    }
 65   
 66  846 public final Latex getName() {
 67  846 return name;
 68    }
 69   
 70    /**
 71    * Set author's email address.
 72    *
 73    * @param email Email address.
 74    */
 75  91 public final void setEmail(final String email) {
 76  91 this.email = email;
 77    }
 78   
 79  732 public final String getEmail() {
 80  732 return email;
 81    }
 82   
 83  148 public boolean equals(final Object obj) {
 84  148 if (!(obj instanceof AuthorVo)) {
 85  5 return false;
 86    }
 87  143 final AuthorVo other = (AuthorVo) obj;
 88  143 return EqualsUtility.equals(getName(), other.getName())
 89    && EqualsUtility.equals(getEmail(), other.getEmail());
 90    }
 91   
 92  126 public int hashCode() {
 93  126 return (getName() != null ? getName().hashCode() : 0)
 94  126 ^ (getEmail() != null ? 1 ^ getEmail().hashCode() : 0);
 95    }
 96   
 97  85 public String toString() {
 98  85 return getName() + (getEmail() != null ? "<" + getEmail() + ">" : "");
 99    }
 100   
 101    }