package net.pterodactylus.sone.data;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
*
* @return All replies to this post
*/
- public Collection<Reply> getReplies() {
+ public Set<Reply> getReplies() {
return Collections.unmodifiableSet(replies);
}
*/
@Override
public int hashCode() {
- return id.hashCode();
+ return id.hashCode() ^ sone.hashCode() ^ (int) (time >> 32) ^ (int) (time & 0xffffffff) ^ text.hashCode();
}
/**
if (!(object instanceof Post)) {
return false;
}
- return ((Post) object).id.equals(id);
+ Post post = (Post) object;
+ return post.id.equals(id) && post.sone.equals(sone) && (post.time == time) && post.text.equals(text);
}
}