Chapter.java 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package eu.kanade.mangafeed.data.models;
  2. import android.support.annotation.NonNull;
  3. import android.support.annotation.Nullable;
  4. import com.pushtorefresh.storio.sqlite.annotations.StorIOSQLiteColumn;
  5. import com.pushtorefresh.storio.sqlite.annotations.StorIOSQLiteType;
  6. import eu.kanade.mangafeed.data.tables.ChaptersTable;
  7. @StorIOSQLiteType(table = ChaptersTable.TABLE)
  8. public class Chapter {
  9. @Nullable
  10. @StorIOSQLiteColumn(name = ChaptersTable.COLUMN_ID, key = true)
  11. public Long id;
  12. @NonNull
  13. @StorIOSQLiteColumn(name = ChaptersTable.COLUMN_MANGA_ID)
  14. public int manga_id;
  15. @NonNull
  16. @StorIOSQLiteColumn(name = ChaptersTable.COLUMN_URL)
  17. public String url;
  18. @NonNull
  19. @StorIOSQLiteColumn(name = ChaptersTable.COLUMN_NAME)
  20. public String name;
  21. @NonNull
  22. @StorIOSQLiteColumn(name = ChaptersTable.COLUMN_READ)
  23. public int read;
  24. @NonNull
  25. @StorIOSQLiteColumn(name = ChaptersTable.COLUMN_DATE_FETCH)
  26. public long date_fetch;
  27. public Chapter() {}
  28. @Override
  29. public boolean equals(Object o) {
  30. if (this == o) return true;
  31. if (o == null || getClass() != o.getClass()) return false;
  32. Chapter chapter = (Chapter) o;
  33. if (manga_id != chapter.manga_id) return false;
  34. if (read != chapter.read) return false;
  35. if (date_fetch != chapter.date_fetch) return false;
  36. if (id != null ? !id.equals(chapter.id) : chapter.id != null) return false;
  37. if (!url.equals(chapter.url)) return false;
  38. return name.equals(chapter.name);
  39. }
  40. @Override
  41. public int hashCode() {
  42. int result = id != null ? id.hashCode() : 0;
  43. result = 31 * result + manga_id;
  44. result = 31 * result + url.hashCode();
  45. result = 31 * result + name.hashCode();
  46. result = 31 * result + read;
  47. result = 31 * result + (int) (date_fetch ^ (date_fetch >>> 32));
  48. return result;
  49. }
  50. }