001/*
002 * SonarQube
003 * Copyright (C) 2009-2017 SonarSource SA
004 * mailto:info AT sonarsource DOT com
005 *
006 * This program is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * This program is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public License
017 * along with this program; if not, write to the Free Software Foundation,
018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
019 */
020package org.sonar.api.database.model;
021
022import org.apache.commons.lang.builder.ToStringBuilder;
023import org.apache.commons.lang.builder.ToStringStyle;
024import org.sonar.api.database.BaseIdentifiable;
025
026/**
027 * @since 2.2
028 */
029public class User extends BaseIdentifiable {
030
031  private String login;
032  private String name;
033  private String email;
034
035  public String getLogin() {
036    return login;
037  }
038
039  public User setLogin(String login) {
040    this.login = login;
041    return this;
042  }
043
044  public String getName() {
045    return name;
046  }
047
048  public User setName(String name) {
049    this.name = name;
050    return this;
051  }
052
053  public String getEmail() {
054    return email;
055  }
056
057  public User setEmail(String email) {
058    this.email = email;
059    return this;
060  }
061
062  @Override
063  public boolean equals(Object o) {
064    if (this == o) {
065      return true;
066    }
067    if (o == null || getClass() != o.getClass()) {
068      return false;
069    }
070    User user = (User) o;
071    return login.equals(user.login);
072  }
073
074  @Override
075  public int hashCode() {
076    return login.hashCode();
077  }
078
079  @Override
080  public String toString() {
081    return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
082  }
083}