mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
115 lines
2.4 KiB
Java
115 lines
2.4 KiB
Java
|
|
package com.cappielloantonio.play.model;
|
||
|
|
|
||
|
|
import android.os.Parcel;
|
||
|
|
import android.os.Parcelable;
|
||
|
|
|
||
|
|
import androidx.annotation.NonNull;
|
||
|
|
import androidx.room.ColumnInfo;
|
||
|
|
import androidx.room.Entity;
|
||
|
|
import androidx.room.PrimaryKey;
|
||
|
|
|
||
|
|
@Entity(tableName = "genre")
|
||
|
|
public class Genre implements Parcelable {
|
||
|
|
@NonNull
|
||
|
|
@PrimaryKey
|
||
|
|
@ColumnInfo(name = "id")
|
||
|
|
public String id;
|
||
|
|
|
||
|
|
@ColumnInfo(name = "name")
|
||
|
|
public String name;
|
||
|
|
|
||
|
|
@ColumnInfo(name = "songCount")
|
||
|
|
public int songCount;
|
||
|
|
|
||
|
|
@ColumnInfo(name = "primary")
|
||
|
|
public String primary;
|
||
|
|
|
||
|
|
@ColumnInfo(name = "blurHash")
|
||
|
|
public String blurHash;
|
||
|
|
|
||
|
|
public Genre(@NonNull String id, String name, int songCount, String primary, String blurHash) {
|
||
|
|
this.id = id;
|
||
|
|
this.name = name;
|
||
|
|
this.songCount = songCount;
|
||
|
|
this.primary = primary;
|
||
|
|
this.blurHash = blurHash;
|
||
|
|
}
|
||
|
|
|
||
|
|
@NonNull
|
||
|
|
public String getId() {
|
||
|
|
return id;
|
||
|
|
}
|
||
|
|
|
||
|
|
public String getName() {
|
||
|
|
return name;
|
||
|
|
}
|
||
|
|
|
||
|
|
public int getSongCount() {
|
||
|
|
return songCount;
|
||
|
|
}
|
||
|
|
|
||
|
|
public String getPrimary() {
|
||
|
|
return primary;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setPrimary(String primary) {
|
||
|
|
this.primary = primary;
|
||
|
|
}
|
||
|
|
|
||
|
|
public String getBlurHash() {
|
||
|
|
return blurHash;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setBlurHash(String blurHash) {
|
||
|
|
this.blurHash = blurHash;
|
||
|
|
}
|
||
|
|
|
||
|
|
@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];
|
||
|
|
}
|
||
|
|
};
|
||
|
|
}
|