package com.andreiolar.abms.shared; import java.util.Map; import com.google.gwt.user.client.rpc.IsSerializable; public class FinishedVoteSession implements IsSerializable { private String voteId; private String title; private String description; private Map<String, Number> results; public FinishedVoteSession() { } public FinishedVoteSession(String voteId, String title, String description, Map<String, Number> results) { this.voteId = voteId; this.title = title; this.description = description; this.results = results; } public String getVoteId() { return voteId; } public void setVoteId(String voteId) { this.voteId = voteId; } 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 Map<String, Number> getResults() { return results; } public void setResults(Map<String, Number> results) { this.results = results; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((description == null) ? 0 : description.hashCode()); result = prime * result + ((results == null) ? 0 : results.hashCode()); result = prime * result + ((title == null) ? 0 : title.hashCode()); result = prime * result + ((voteId == null) ? 0 : voteId.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; FinishedVoteSession other = (FinishedVoteSession) obj; if (description == null) { if (other.description != null) return false; } else if (!description.equals(other.description)) return false; if (results == null) { if (other.results != null) return false; } else if (!results.equals(other.results)) return false; if (title == null) { if (other.title != null) return false; } else if (!title.equals(other.title)) return false; if (voteId == null) { if (other.voteId != null) return false; } else if (!voteId.equals(other.voteId)) return false; return true; } }