Notification.java 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* Copyright 2017 Andrew Dawson
  2. *
  3. * This file is a part of Tusky.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it under the terms of the
  6. * GNU General Public License as published by the Free Software Foundation; either version 3 of the
  7. * License, or (at your option) any later version.
  8. *
  9. * Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  10. * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  11. * Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License along with Tusky; if not,
  14. * see <http://www.gnu.org/licenses>. */
  15. package com.keylesspalace.tusky.entity;
  16. import com.google.gson.annotations.SerializedName;
  17. public class Notification {
  18. public enum Type {
  19. @SerializedName("mention")
  20. MENTION,
  21. @SerializedName("reblog")
  22. REBLOG,
  23. @SerializedName("favourite")
  24. FAVOURITE,
  25. @SerializedName("follow")
  26. FOLLOW,
  27. }
  28. public Type type;
  29. public String id;
  30. public Account account;
  31. public Status status;
  32. @Override
  33. public int hashCode() {
  34. return id.hashCode();
  35. }
  36. @Override
  37. public boolean equals(Object other) {
  38. if (this.id == null) {
  39. return this == other;
  40. } else if (!(other instanceof Notification)) {
  41. return false;
  42. }
  43. Notification notification = (Notification) other;
  44. return notification.id.equals(this.id);
  45. }
  46. }