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     */
020    package org.sonar.wsclient.services;
021    
022    import javax.annotation.CheckForNull;
023    import javax.annotation.Nullable;
024    
025    import java.util.Date;
026    
027    public 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      private String data;
036    
037      @CheckForNull
038      public String getId() {
039        return id;
040      }
041    
042      public Event setId(@Nullable String id) {
043        this.id = id;
044        return this;
045      }
046    
047      @CheckForNull
048      public String getName() {
049        return name;
050      }
051    
052      public Event setName(@Nullable String name) {
053        this.name = name;
054        return this;
055      }
056    
057      @CheckForNull
058      public String getCategory() {
059        return category;
060      }
061    
062      public Event setCategory(@Nullable String category) {
063        this.category = category;
064        return this;
065      }
066    
067      @CheckForNull
068      public String getDescription() {
069        return description;
070      }
071    
072      public Event setDescription(@Nullable String description) {
073        this.description = description;
074        return this;
075      }
076    
077      @CheckForNull
078      public Date getDate() {
079        return date;
080      }
081    
082      public Event setDate(@Nullable Date date) {
083        this.date = date;
084        return this;
085      }
086    
087      @CheckForNull
088      public String getResourceKey() {
089        return resourceKey;
090      }
091    
092      public Event setResourceKey(@Nullable String resourceKey) {
093        this.resourceKey = resourceKey;
094        return this;
095      }
096    
097      @CheckForNull
098      public String getData() {
099        return data;
100      }
101    
102      public Event setData(@Nullable String data) {
103        this.data = data;
104        return this;
105      }
106    
107      @Override
108      public boolean equals(Object o) {
109        if (this == o) {
110          return true;
111        }
112        if (o == null || getClass() != o.getClass()) {
113          return false;
114        }
115    
116        Event event = (Event) o;
117        return !(id != null ? !id.equals(event.id) : event.id != null);
118      }
119    
120      @Override
121      public int hashCode() {
122        return id != null ? id.hashCode() : 0;
123      }
124    }