Last active
January 2, 2016 14:19
-
-
Save rominirani/8315482 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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