Skip to content

Instantly share code, notes, and snippets.

@rominirani
Last active January 2, 2016 14:19
Show Gist options
  • Save rominirani/8315482 to your computer and use it in GitHub Desktop.
Save rominirani/8315482 to your computer and use it in GitHub Desktop.
package com.mindstorm.famousquotes.entity;
public class Quote {
Integer id;
String author;
String message;
public Quote() {
}
public Quote(Integer id) {
super();
this.id = id;
}
public Quote(Integer id, String author, String message) {
super();
this.id = id;
this.author = author;
this.message = message;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.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;
Quote other = (Quote) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
@Override
public String toString() {
return "Quote [id=" + id + ", author=" + author + ", message="
+ message + "]";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment