Created
July 3, 2012 15:31
-
-
Save AndyBowes/3040495 to your computer and use it in GitHub Desktop.
MondoDB Domain Class
This file contains 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
public class Album { | |
private ObjectId _id; | |
private String artist; | |
private String title; | |
private List<Song> tracks; | |
public ObjectId getId() { | |
return _id; | |
} | |
public void setId(ObjectId id) { | |
this._id = id; | |
} | |
... Standard Accessors/Mutators ... | |
@Override | |
public boolean equals(Object o) { | |
if (this == o) return true; | |
if (o == null || getClass() != o.getClass()) return false; | |
Album album = (Album) o; | |
if (!_id.equals(album._id)) return false; | |
return true; | |
} | |
@Override | |
public int hashCode() { | |
return _id.hashCode(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment