Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.24 KB | None | 0 0
  1. package com.example.moviescataloguelocal.model;
  2.  
  3. import android.os.Parcel;
  4. import android.os.Parcelable;
  5.  
  6. import androidx.annotation.NonNull;
  7. import androidx.room.Entity;
  8. import androidx.room.PrimaryKey;
  9.  
  10. import com.google.gson.annotations.Expose;
  11. import com.google.gson.annotations.SerializedName;
  12.  
  13. import java.util.Objects;
  14.  
  15. @Entity(tableName = "movies")
  16. public class Movies implements Parcelable {
  17.  
  18.     @NonNull
  19.     @PrimaryKey
  20.     @SerializedName("id")
  21.     private String id;
  22.  
  23.     @SerializedName("poster_path")
  24.     @Expose
  25.     private String posterPath;
  26.  
  27.     @SerializedName("title")
  28.     @Expose
  29.     private String title;
  30.  
  31.     @SerializedName("release_date")
  32.     @Expose
  33.     private String releaseDate;
  34.  
  35.     @SerializedName("vote_average")
  36.     @Expose
  37.     private String voteAverage;
  38.  
  39.     @SerializedName("popularity")
  40.     @Expose
  41.     private String  popularity;
  42.  
  43.     @SerializedName("overview")
  44.     @Expose
  45.     private String overview;
  46.  
  47.     public String getId() {
  48.         return id;
  49.     }
  50.  
  51.     public void setId(@NonNull String id) {
  52.         this.id = id;
  53.     }
  54.  
  55.  
  56.     public String getPosterPath() {
  57.         return posterPath;
  58.     }
  59.  
  60.     public void setPosterPath(String posterPath) {
  61.         this.posterPath = posterPath;
  62.     }
  63.  
  64.     public String getTitle() {
  65.         return title;
  66.     }
  67.  
  68.     public void setTitle(String title) {
  69.         this.title = title;
  70.     }
  71.  
  72.     public String getReleaseDate() {
  73.         return releaseDate;
  74.     }
  75.  
  76.     public void setReleaseDate(String releaseDate) {
  77.         this.releaseDate = releaseDate;
  78.     }
  79.  
  80.     public String getVoteAverage() {
  81.         return voteAverage;
  82.     }
  83.  
  84.     public void setVoteAverage(String voteAverage) {
  85.         this.voteAverage = voteAverage;
  86.     }
  87.  
  88.     public String getPopularity() {
  89.         return popularity;
  90.     }
  91.  
  92.     public void setPopularity(String popularity) {
  93.         this.popularity = popularity;
  94.     }
  95.  
  96.     public String getOverview() {
  97.         return overview;
  98.     }
  99.  
  100.     public void setOverview(String overview) {
  101.         this.overview = overview;
  102.     }
  103.  
  104.     @Override
  105.     public int describeContents() {
  106.         return 0;
  107.     }
  108.  
  109.     @Override
  110.     public void writeToParcel(Parcel dest, int flags) {
  111.         dest.writeString(this.id);
  112.         dest.writeString(this.posterPath);
  113.         dest.writeString(this.title);
  114.         dest.writeString(this.releaseDate);
  115.         dest.writeString(this.voteAverage);
  116.         dest.writeString(this.popularity);
  117.         dest.writeString(this.overview);
  118.  
  119.     }
  120.  
  121.     public Movies(){
  122.  
  123.     }
  124.  
  125.     protected Movies(Parcel in){
  126.         this.id = Objects.requireNonNull(in.readString());
  127.         this.posterPath = in.readString();
  128.         this.title = in.readString();
  129.         this.releaseDate = in.readString();
  130.         this.voteAverage = in.readString();
  131.         this.popularity = in.readString();
  132.         this.overview = in.readString();
  133.     }
  134.  
  135.     public static final Creator<Movies> CREATOR = new Creator<Movies>() {
  136.         @Override
  137.         public Movies createFromParcel(Parcel source) {
  138.             return new Movies(source);
  139.         }
  140.  
  141.         @Override
  142.         public Movies[] newArray(int size) {
  143.             return new Movies[size];
  144.         }
  145.     };
  146. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement