001/*
002 * SonarQube, open source software quality management tool.
003 * Copyright (C) 2008-2014 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * SonarQube 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 * SonarQube 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.wsclient.services;
021
022import javax.annotation.CheckForNull;
023import javax.annotation.Nullable;
024
025import java.util.Date;
026
027public class Event extends Model {
028
029  private String id;
030  private String name;
031  private String category;
032  private String description;
033  private String resourceKey;
034  private Date date;
035
036  @CheckForNull
037  public String getId() {
038    return id;
039  }
040
041  public Event setId(@Nullable String id) {
042    this.id = id;
043    return this;
044  }
045
046  @CheckForNull
047  public String getName() {
048    return name;
049  }
050
051  public Event setName(@Nullable String name) {
052    this.name = name;
053    return this;
054  }
055
056  @CheckForNull
057  public String getCategory() {
058    return category;
059  }
060
061  public Event setCategory(@Nullable String category) {
062    this.category = category;
063    return this;
064  }
065
066  @CheckForNull
067  public String getDescription() {
068    return description;
069  }
070
071  public Event setDescription(@Nullable String description) {
072    this.description = description;
073    return this;
074  }
075
076  @CheckForNull
077  public Date getDate() {
078    return date;
079  }
080
081  public Event setDate(@Nullable Date date) {
082    this.date = date;
083    return this;
084  }
085
086  @CheckForNull
087  public String getResourceKey() {
088    return resourceKey;
089  }
090
091  public Event setResourceKey(@Nullable String resourceKey) {
092    this.resourceKey = resourceKey;
093    return this;
094  }
095
096  @Override
097  public boolean equals(Object o) {
098    if (this == o) {
099      return true;
100    }
101    if (o == null || getClass() != o.getClass()) {
102      return false;
103    }
104
105    Event event = (Event) o;
106    return !(id != null ? !id.equals(event.id) : event.id != null);
107  }
108
109  @Override
110  public int hashCode() {
111    return id != null ? id.hashCode() : 0;
112  }
113}