Message.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. package com.noahvogt.miniprojekt.DataBase;
  2. import androidx.annotation.NonNull;
  3. import androidx.room.ColumnInfo;
  4. import androidx.room.Entity;
  5. import androidx.room.PrimaryKey;
  6. /* @Embedded to express entitys together
  7. * https://developer.android.com/training/data-storage/room/relationships
  8. * to learn more */
  9. @Entity(tableName = "message_table")
  10. public class Message {
  11. @PrimaryKey (autoGenerate = true)
  12. public int id;
  13. /* name of Columm */
  14. @NonNull
  15. @ColumnInfo(name = "to")
  16. private String mTo ;
  17. @ColumnInfo(name = "cc")
  18. private String mCc;
  19. @ColumnInfo(name = "bcc")
  20. private String mBcc; //blind carpet copy, not see who sees mails
  21. @NonNull
  22. @ColumnInfo(name = "fromEmail")
  23. private String mFrom;
  24. @NonNull
  25. @ColumnInfo(name = "date")
  26. private String mDate;
  27. @ColumnInfo(name = "subject")
  28. private String mSubject;
  29. @ColumnInfo(name = "textContent")
  30. private String mTextContent;
  31. @NonNull
  32. @ColumnInfo(name = "folder")
  33. private String mFolder;
  34. @ColumnInfo(name = "seen")
  35. private boolean mSeen;
  36. public String getTo(){return this.mTo;}
  37. public String getFrom(){return this.mFrom;}
  38. public String getCc(){return this.mCc;}
  39. public String getBcc(){return this.mBcc;}
  40. public String getDate(){return this.mDate;}
  41. public String getSubject(){return this.mSubject;}
  42. public String getTextContent(){return this.mTextContent;}
  43. public String getFolder(){return this.mFolder;}
  44. public int getId(){return this.id;}
  45. public boolean isSeen() {return this.mSeen;}
  46. public Message(
  47. @NonNull String to,
  48. String cc,
  49. String bcc,
  50. @NonNull String from,
  51. @NonNull String date,
  52. String subject,
  53. String textContent,
  54. @NonNull String folder,
  55. @NonNull boolean seen) {
  56. this.mTo = to;
  57. this.mFrom = from;
  58. this.mCc = cc;
  59. this.mBcc = bcc;
  60. this.mDate = date;
  61. this.mSubject = subject;
  62. this.mTextContent = textContent;
  63. this.mFolder = folder;
  64. this.mSeen = seen;
  65. }
  66. }