content: package com.an.paginglibrary.sample.model;
  
  import android.os.Parcel;
  import android.os.Parcelable;
  import android.support.annotation.NonNull;
  import android.support.v7.util.DiffUtil;
  
  import com.an.paginglibrary.sample.utils.AppUtils;
  
  
  public class Article implements Parcelable {
  
      private static int increment = 0;
  
      private long id;
      private String author;
      private String title;
      private String description;
      private String url;
      private String urlToImage;
      private String publishedAt;
      private Source source;
  
      public Article() {
          id = ++increment;
      }
  
  
      protected Article(Parcel in) {
          id = AppUtils.getRandomNumber();
          author = in.readString();
          title = in.readString();
          description = in.readString();
          url = in.readString();
          urlToImage = in.readString();
          publishedAt = in.readString();
          source = in.readParcelable(Source.class.getClassLoader());
      }
  
      @Override
      public void writeToParcel(Parcel dest, int flags) {
          dest.writeLong(id);
          dest.writeString(author);
          dest.writeString(title);
          dest.writeString(description);
          dest.writeString(url);
          dest.writeString(urlToImage);
          dest.writeString(publishedAt);
          dest.writeParcelable(source, flags);
      }
  
      @Override
      public int describeContents() {
          return 0;
      }
  
      public static final Creator<Article> CREATOR = new Creator<Article>() {
          @Override
          public Article createFromParcel(Parcel in) {
              return new Article(in);
          }
  
          @Override
          public Article[] newArray(int size) {
              return new Article[size];
          }
      };
  
      public long getId() {
          return id;
      }
  
      protected void setId() {}
  
      public String getAuthor() {
          return author;
      }
  
      public void setAuthor(String author) {
          this.author = author;
      }
  
      public String getTitle() {
          return title;
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  
      public String getDescription() {
          return description;
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  
      public String getUrl() {
          return url;
      }
  
      public void setUrl(String url) {
          this.url = url;
      }
  
      public String getUrlToImage() {
          return urlToImage;
      }
  
      public void setUrlToImage(String urlToImage) {
          this.urlToImage = urlToImage;
      }
  
      public String getPublishedAt() {
          return publishedAt;
      }
  
      public void setPublishedAt(String publishedAt) {
          this.publishedAt = publishedAt;
      }
  
      public Source getSource() {
          return source;
      }
  
      public void setSource(Source source) {
          this.source = source;
      }
  
  
      public static DiffUtil.ItemCallback<Article> DIFF_CALLBACK = new DiffUtil.ItemCallback<Article>() {
          @Override
          public boolean areItemsTheSame(@NonNull Article oldItem, @NonNull Article newItem) {
              return oldItem.id == newItem.id;
          }
  
          @Override
          public boolean areContentsTheSame(@NonNull Article oldItem, @NonNull Article newItem) {
              return oldItem.equals(newItem);
          }
      };
  
      @Override
      public boolean equals(Object obj) {
          if (obj == this)
              return true;
  
          Article article = (Article) obj;
          return article.id == this.id;
      }
  }
  