Skip to content

Instantly share code, notes, and snippets.

@mitchtabian
Last active May 8, 2024 15:32
Show Gist options
  • Save mitchtabian/8aafe47cff8b05bff2cd1e6cf7d2f01e to your computer and use it in GitHub Desktop.
Save mitchtabian/8aafe47cff8b05bff2cd1e6cf7d2f01e to your computer and use it in GitHub Desktop.
@Entity(tableName = "notes")
public class Note {
@PrimaryKey(autoGenerate = true)
private int id;
@NonNull
@ColumnInfo(name = "title")
private String title;
@ColumnInfo(name = "content")
private String content;
@ColumnInfo(name = "timestamp")
private String timestamp;
public Note(String title, String content, String timestamp) {
this.title = title;
this.content = content;
this.timestamp = timestamp;
}
@Ignore
public Note() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getTimestamp() {
return timestamp;
}
public void setTimestamp(String timestamp) {
this.timestamp = timestamp;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment