Guest User

Untitled

a guest
Nov 20th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public class Album {
  2.  
  3. private ObjectId _id;
  4.  
  5. private String artist;
  6. private String title;
  7. private List<Song> tracks;
  8.  
  9. public ObjectId getId() {
  10. return _id;
  11. }
  12.  
  13. public void setId(ObjectId id) {
  14. this._id = id;
  15. }
  16.  
  17. ... Standard Accessors/Mutators ...
  18.  
  19. @Override
  20. public boolean equals(Object o) {
  21. if (this == o) return true;
  22. if (o == null || getClass() != o.getClass()) return false;
  23.  
  24. Album album = (Album) o;
  25.  
  26. if (!_id.equals(album._id)) return false;
  27.  
  28. return true;
  29. }
  30.  
  31. @Override
  32. public int hashCode() {
  33. return _id.hashCode();
  34. }
  35. }
Add Comment
Please, Sign In to add comment