package com.olivierpayen.popularmovies.model;

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

import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;
import java.util.List;

public class Movie implements Parcelable {
    public Boolean adult;
    @SerializedName("backdrop_path")
    public String  backdropPath;
    @SerializedName("genre_ids")
    public List<Integer> genreIds = new ArrayList<>();
    public Integer id;
    public String  originalLanguage;
    @SerializedName("original_title")
    public String  originalTitle;
    public String  overview;
    @SerializedName("release_date")
    public String  releaseDate;
    @SerializedName("poster_path")
    public String  posterPath;
    public Double  popularity;
    public String  title;
    public Boolean video;
    @SerializedName("vote_average")
    public Double  voteAverage;
    @SerializedName("vote_count")
    public Integer voteCount;

    public Movie(String title) {
        this.title = title;
    }

    private static final String BASE_IMG_URL = "http://image.tmdb.org/t/p/";

    public String getPosterUrl() {
        if (posterPath == null) {
            return null;
        }
        else {
            return BASE_IMG_URL + "w185" + posterPath;
        }
    }

    protected Movie(Parcel in) {
        byte adultVal = in.readByte();
        adult = adultVal == 0x02 ? null : adultVal != 0x00;
        backdropPath = in.readString();
        if (in.readByte() == 0x01) {
            genreIds = new ArrayList<>();
            in.readList(genreIds, Integer.class.getClassLoader());
        } else {
            genreIds = null;
        }
        id = in.readByte() == 0x00 ? null : in.readInt();
        originalLanguage = in.readString();
        originalTitle = in.readString();
        overview = in.readString();
        releaseDate = in.readString();
        posterPath = in.readString();
        popularity = in.readByte() == 0x00 ? null : in.readDouble();
        title = in.readString();
        byte videoVal = in.readByte();
        video = videoVal == 0x02 ? null : videoVal != 0x00;
        voteAverage = in.readByte() == 0x00 ? null : in.readDouble();
        voteCount = in.readByte() == 0x00 ? null : in.readInt();
    }

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

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (adult == null) {
            dest.writeByte((byte) (0x02));
        } else {
            dest.writeByte((byte) (adult ? 0x01 : 0x00));
        }
        dest.writeString(backdropPath);
        if (genreIds == null) {
            dest.writeByte((byte) (0x00));
        } else {
            dest.writeByte((byte) (0x01));
            dest.writeList(genreIds);
        }
        if (id == null) {
            dest.writeByte((byte) (0x00));
        } else {
            dest.writeByte((byte) (0x01));
            dest.writeInt(id);
        }
        dest.writeString(originalLanguage);
        dest.writeString(originalTitle);
        dest.writeString(overview);
        dest.writeString(releaseDate);
        dest.writeString(posterPath);
        if (popularity == null) {
            dest.writeByte((byte) (0x00));
        } else {
            dest.writeByte((byte) (0x01));
            dest.writeDouble(popularity);
        }
        dest.writeString(title);
        if (video == null) {
            dest.writeByte((byte) (0x02));
        } else {
            dest.writeByte((byte) (video ? 0x01 : 0x00));
        }
        if (voteAverage == null) {
            dest.writeByte((byte) (0x00));
        } else {
            dest.writeByte((byte) (0x01));
            dest.writeDouble(voteAverage);
        }
        if (voteCount == null) {
            dest.writeByte((byte) (0x00));
        } else {
            dest.writeByte((byte) (0x01));
            dest.writeInt(voteCount);
        }
    }

    @SuppressWarnings("unused")
    public static final Parcelable.Creator<Movie> CREATOR = new Parcelable.Creator<Movie>() {
        @Override
        public Movie createFromParcel(Parcel in) {
            return new Movie(in);
        }

        @Override
        public Movie[] newArray(int size) {
            return new Movie[size];
        }
    };
}
@@ -1272,24 +1272,221 @@
    %7D%0A    %7D%0A%0A
+    public String getBackdropUrl() %7B%0A        if (backdropPath == null) %7B%0A            return null;%0A        %7D%0A        else %7B%0A            return BASE_IMG_URL + %22w185%22 + backdropPath;%0A        %7D%0A    %7D%0A%0A
     protecte

Add the Movie.getBackdropUrl method