/*
*
* * Copyright 2013 Jive Software
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
*/
package com.jivesoftware.sdk.api.tile.data;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import java.io.Serializable;
/**
* Created by rrutan on 2/4/14.
*/
@JsonSerialize(include=JsonSerialize.Inclusion.NON_DEFAULT)
public class CalendarEvent implements Serializable {
@JsonSerialize(include=JsonSerialize.Inclusion.ALWAYS)
private String start;
private String duration;
private String location;
@JsonSerialize(include=JsonSerialize.Inclusion.ALWAYS)
private String title;
private String description;
private int attendees;
private TileAction action;
public CalendarEvent() {
start = null;
duration = null;
location = null;
title = null;
description = null;
attendees = 0;
action = null;
} // end constructor
public String getStart() {
return start;
}
public void setStart(String start) {
this.start = start;
}
public String getDuration() {
return duration;
}
public void setDuration(String duration) {
this.duration = duration;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public int getAttendees() {
return attendees;
}
public void setAttendees(int attendees) {
this.attendees = attendees;
}
public TileAction getAction() {
return action;
}
public void setAction(TileAction action) {
this.action = action;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CalendarEvent that = (CalendarEvent) o;
if (attendees != that.attendees) return false;
if (action != null ? !action.equals(that.action) : that.action != null) return false;
if (description != null ? !description.equals(that.description) : that.description != null) return false;
if (duration != null ? !duration.equals(that.duration) : that.duration != null) return false;
if (location != null ? !location.equals(that.location) : that.location != null) return false;
if (start != null ? !start.equals(that.start) : that.start != null) return false;
if (title != null ? !title.equals(that.title) : that.title != null) return false;
return true;
}
@Override
public int hashCode() {
int result = start != null ? start.hashCode() : 0;
result = 31 * result + (duration != null ? duration.hashCode() : 0);
result = 31 * result + (location != null ? location.hashCode() : 0);
result = 31 * result + (title != null ? title.hashCode() : 0);
result = 31 * result + (description != null ? description.hashCode() : 0);
result = 31 * result + attendees;
result = 31 * result + (action != null ? action.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "CalendarEvent{" +
"start='" + start + '\'' +
", duration='" + duration + '\'' +
", location='" + location + '\'' +
", title='" + title + '\'' +
", description='" + description + '\'' +
", attendees=" + attendees +
", action=" + action +
'}';
}
} // end class