Artist view multi select support.

This commit is contained in:
Karim Abou Zeid 2015-05-25 15:18:02 +02:00
commit ab678b43ca
3 changed files with 107 additions and 14 deletions

View file

@ -1,5 +1,7 @@
package com.kabouzeid.gramophone.model;
import android.text.TextUtils;
/**
* @author Karim Abou Zeid (kabouzeid)
*/
@ -22,4 +24,44 @@ public class Artist {
songCount = -1;
albumCount = -1;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + albumCount;
result = prime * result + id;
result = prime * result + (name == null ? 0 : name.hashCode());
result = prime * result + songCount;
return result;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Artist other = (Artist) obj;
if (albumCount != other.albumCount) {
return false;
}
if (id != other.id) {
return false;
}
if (!TextUtils.equals(name, other.name)) {
return false;
}
return songCount == other.songCount;
}
@Override
public String toString() {
return name;
}
}