package org.mindframes.latestfm.lastfm.vo;

import android.os.Parcel;
import android.os.Parcelable;

import com.fasterxml.jackson.annotation.JsonProperty;

public class Result implements Parcelable {

    @JsonProperty("topartists")
    public TopArtists topArtists;

    @JsonProperty("toptracks")
    public TopTracks topTracks;

    @JsonProperty("topalbums")
    public TopAlbums topAlbums;

    public int error = -1;
    public String message;

    public TopArtists getTopArtists() {
        return topArtists;
    }

    public void setTopArtists(TopArtists topArtists) {
        this.topArtists = topArtists;
    }

    public TopTracks getTopTracks() {
        return topTracks;
    }

    public void setTopTracks(TopTracks topTracks) {
        this.topTracks = topTracks;
    }

    public TopAlbums getTopAlbums() {
        return topAlbums;
    }

    public void setTopAlbums(TopAlbums topAlbums) {
        this.topAlbums = topAlbums;
    }

    public int getError() {
        return error;
    }

    public void setError(int error) {
        this.error = error;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Result() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.topArtists, 0);
        dest.writeParcelable(this.topTracks, 0);
        dest.writeParcelable(this.topAlbums, 0);
        dest.writeInt(this.error);
        dest.writeString(this.message);
    }

    private Result(Parcel in) {
        this.topArtists = in.readParcelable(TopArtists.class.getClassLoader());
        this.topTracks = in.readParcelable(TopTracks.class.getClassLoader());
        this.topAlbums = in.readParcelable(TopAlbums.class.getClassLoader());
        this.error = in.readInt();
        this.message = in.readString();
    }

    public static final Creator<Result> CREATOR = new Creator<Result>() {
        public Result createFromParcel(Parcel source) {
            return new Result(source);
        }

        public Result[] newArray(int size) {
            return new Result[size];
        }
    };
}