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.sonar.api.database.BaseIdentifiable;
023
024/**
025 * @since 2.2
026 */
027public class User extends BaseIdentifiable {
028
029  private String login;
030  private String name;
031  private String email;
032
033  public String getLogin() {
034    return login;
035  }
036
037  public User setLogin(String login) {
038    this.login = login;
039    return this;
040  }
041
042  public String getName() {
043    return name;
044  }
045
046  public User setName(String name) {
047    this.name = name;
048    return this;
049  }
050
051  public String getEmail() {
052    return email;
053  }
054
055  public User setEmail(String email) {
056    this.email = email;
057    return this;
058  }
059
060  @Override
061  public boolean equals(Object o) {
062    if (this == o) {
063      return true;
064    }
065    if (o == null || getClass() != o.getClass()) {
066      return false;
067    }
068    User user = (User) o;
069    return login.equals(user.login);
070  }
071
072  @Override
073  public int hashCode() {
074    return login.hashCode();
075  }
076
077  @Override
078  public String toString() {
079    StringBuilder sb = new StringBuilder("User{");
080    sb.append("login='").append(login).append('\'');
081    sb.append(", name='").append(name).append('\'');
082    sb.append(", email='").append(email).append('\'');
083    sb.append('}');
084    return sb.toString();
085  }
086}