/*
 * Copyright (C) 2015 Mateusz Widuch. All rights reserved.
 */

package eu.redray.trevie;

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

/**
 * Represents movie item.
 */
public class Movie implements Parcelable {
    public static final String EXTRA_DETAILS = "movie_details";
    public static final Creator<Movie> CREATOR = new Creator<Movie>() {
        @Override
        public Movie createFromParcel(Parcel in) {
            return new Movie(in);
        }

        @Override
        public Movie[] newArray(int size) {
            return new Movie[size];
        }
    };
    private String mTitle;
    private String mReleaseDate;
    private String mRating;
    private String mSynopsis;
    private String mPosterPath;

    public Movie(String title, String releaseDate, String avgRating, String overview, String posterPath) {
        mTitle = title;
        mReleaseDate = releaseDate;
        mRating = avgRating;
        mSynopsis = overview;
        mPosterPath = posterPath;
    }

    protected Movie(Parcel in) {
        mTitle = in.readString();
        mReleaseDate = in.readString();
        mRating = in.readString();
        mSynopsis = in.readString();
        mPosterPath = in.readString();
    }

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

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(mTitle);
        dest.writeString(mReleaseDate);
        dest.writeString(mRating);
        dest.writeString(mSynopsis);
        dest.writeString(mPosterPath);
    }

    public String getPosterPath() {
        return mPosterPath;
    }

    public String getTitle() {
        return mTitle;
    }

    public String getReleaseDate() {
        return mReleaseDate;
    }

    public String getRating() {
        return mRating;
    }

    public String getSynopsis() {
        return mSynopsis;
    }

    public String getReleaseYear() {
        return mReleaseDate.substring(0, 4);
    }
}

@@ -144,16 +144,40 @@
 lable;%0A%0A
+import java.util.List;%0A%0A
 /**%0A * R
@@ -245,16 +245,17 @@
 lable %7B%0A
+%0A
     publ
@@ -610,16 +610,41 @@
 %7D%0A    %7D;
+%0A%0A    private String mId;
 %0A    pri
@@ -785,16 +785,116 @@
 terPath;
+%0A    private String mRuntime;%0A    private List%3CString%3E mGenres;%0A    private List%3CString%3E mCountries;
 %0A%0A    pu
@@ -911,16 +911,27 @@
 (String 
+id, String 
 title, S
@@ -1001,19 +1001,115 @@
 sterPath
-) %7B
+,%0A                 String runtime, List%3CString%3E genres, List%3CString%3E countries) %7B%0A        mId = id;
 %0A       
@@ -1246,32 +1246,118 @@
 h = posterPath;%0A
+        mRuntime = runtime;%0A        mGenres = genres;%0A        mCountries = countries;%0A
     %7D%0A%0A    prote
@@ -1372,32 +1372,63 @@
 ie(Parcel in) %7B%0A
+        mId = in.readString();%0A
         mTitle =
@@ -1592,24 +1592,197 @@
 adString();%0A
+        mRuntime = in.readString();%0A        mGenres = in.readArrayList(String.class.getClassLoader());%0A        mCountries = in.readArrayList(String.class.getClassLoader());%0A
     %7D%0A%0A    @
@@ -1917,24 +1917,55 @@
 nt flags) %7B%0A
+        dest.writeString(mId);%0A
         dest
@@ -2137,16 +2137,121 @@
 rPath);%0A
+        dest.writeString(mRuntime);%0A        dest.writeList(mGenres);%0A        dest.writeList(mCountries);%0A
     %7D%0A%0A 
@@ -2671,11 +2671,220 @@
 );%0A    %7D
+%0A%0A    public String getRuntime() %7B%0A        return mRuntime;%0A    %7D%0A%0A    public List%3CString%3E getGenres() %7B%0A        return mGenres;%0A    %7D%0A%0A    public List%3CString%3E getCountries() %7B%0A        return mCountries;%0A    %7D
 %0A%7D%0A

Add additional fields to Movie class