aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-08-28 15:19:25 -0700
committerScott Jackson <daneren2005@gmail.com>2014-08-28 15:19:25 -0700
commitc8d6607ecc3a7e2dcdd4c5356325b91b54a4b2ed (patch)
treedee462597f7bc75c50e563c4f26a1bc8ba41cd06 /src/github
parent3933c47e9fd74f38caac8f8643e33a8f30fc7220 (diff)
downloaddsub-c8d6607ecc3a7e2dcdd4c5356325b91b54a4b2ed.tar.gz
dsub-c8d6607ecc3a7e2dcdd4c5356325b91b54a4b2ed.tar.bz2
dsub-c8d6607ecc3a7e2dcdd4c5356325b91b54a4b2ed.zip
Add playlists equals method which allows argument to be id (string)
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/domain/Playlist.java26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/domain/Playlist.java b/src/github/daneren2005/dsub/domain/Playlist.java
index 663fa2b0..5bf6753a 100644
--- a/src/github/daneren2005/dsub/domain/Playlist.java
+++ b/src/github/daneren2005/dsub/domain/Playlist.java
@@ -105,8 +105,24 @@ public class Playlist implements Serializable {
this.pub = pub;
}
- @Override
- public String toString() {
- return name;
- }
-} \ No newline at end of file
+ @Override
+ public String toString() {
+ return name;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if(o == this) {
+ return true;
+ } else if(o == null) {
+ return false;
+ } else if(o instanceof String) {
+ return o.equals(this.id);
+ } else if(o.getClass() != getClass()) {
+ return false;
+ }
+
+ Playlist playlist = (Playlist) o;
+ return o.id.equals(this.id);
+ }
+}