mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
80 lines
1.8 KiB
Java
80 lines
1.8 KiB
Java
package com.cappielloantonio.play.model;
|
|
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
public class Genre implements Parcelable {
|
|
private String id;
|
|
private String name;
|
|
private int songCount;
|
|
private int albumCount;
|
|
|
|
public Genre(com.cappielloantonio.play.subsonic.models.Genre genre) {
|
|
this.id = genre.getGenre();
|
|
this.name = genre.getGenre();
|
|
this.songCount = genre.getSongCount();
|
|
this.albumCount = genre.getAlbumCount();
|
|
}
|
|
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public int getSongCount() {
|
|
return songCount;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) return true;
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
|
|
Genre genre = (Genre) o;
|
|
return id.equals(genre.id);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return id.hashCode();
|
|
}
|
|
|
|
@NonNull
|
|
@Override
|
|
public String toString() {
|
|
return id;
|
|
}
|
|
|
|
@Override
|
|
public int describeContents() {
|
|
return 0;
|
|
}
|
|
|
|
@Override
|
|
public void writeToParcel(Parcel dest, int flags) {
|
|
dest.writeString(this.id);
|
|
dest.writeString(this.name);
|
|
dest.writeInt(this.songCount);
|
|
}
|
|
|
|
protected Genre(Parcel in) {
|
|
this.id = in.readString();
|
|
this.name = in.readString();
|
|
this.songCount = in.readInt();
|
|
}
|
|
|
|
public static final Creator<Genre> CREATOR = new Creator<Genre>() {
|
|
public Genre createFromParcel(Parcel source) {
|
|
return new Genre(source);
|
|
}
|
|
|
|
public Genre[] newArray(int size) {
|
|
return new Genre[size];
|
|
}
|
|
};
|
|
}
|