Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.4 KiB

6 years ago
  1. package eu.faircode.email;
  2. /*
  3. This file is part of Safe email.
  4. Safe email is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. NetGuard is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with NetGuard. If not, see <http://www.gnu.org/licenses/>.
  14. Copyright 2018 by Marcel Bokhorst (M66B)
  15. */
  16. import android.arch.persistence.room.Entity;
  17. import android.arch.persistence.room.PrimaryKey;
  18. import android.support.annotation.NonNull;
  19. @Entity(
  20. tableName = EntityIdentity.TABLE_NAME,
  21. indices = {
  22. }
  23. )
  24. public class EntityIdentity {
  25. static final String TABLE_NAME = "identity";
  26. @PrimaryKey(autoGenerate = true)
  27. public Long id;
  28. @NonNull
  29. public String name;
  30. @NonNull
  31. public String email;
  32. public String replyto;
  33. @NonNull
  34. public String host; // SMTP
  35. @NonNull
  36. public Integer port;
  37. @NonNull
  38. public Boolean starttls;
  39. @NonNull
  40. public String user;
  41. @NonNull
  42. public String password;
  43. @NonNull
  44. public Boolean primary;
  45. @NonNull
  46. public Boolean synchronize;
  47. @Override
  48. public boolean equals(Object obj) {
  49. if (obj instanceof EntityIdentity) {
  50. EntityIdentity other = (EntityIdentity) obj;
  51. return (this.name.equals(other.name) &&
  52. this.email.equals(other.email) &&
  53. (this.replyto == null ? other.replyto == null : this.replyto.equals(other.replyto)) &&
  54. this.host.equals(other.host) &&
  55. this.port.equals(other.port) &&
  56. this.starttls.equals(other.starttls) &&
  57. this.user.equals(other.user) &&
  58. this.password.equals(other.password) &&
  59. this.primary.equals(other.primary) &&
  60. this.synchronize.equals(other.synchronize));
  61. } else
  62. return false;
  63. }
  64. @Override
  65. public String toString() {
  66. return name + (primary ? " ★" : "");
  67. }
  68. }