Note

data class Note(val id: Int = 0, val title: String, val content: String, val timestamp: Long = System.currentTimeMillis(), val isDeleted: Boolean = false)

Represents a single note entity in the application. This data class is used by Room to create the 'notes' table in the database. Each instance of this class corresponds to a row in the 'notes' table.

Constructors

Link copied to clipboard
constructor(id: Int = 0, title: String, content: String, timestamp: Long = System.currentTimeMillis(), isDeleted: Boolean = false)

Properties

Link copied to clipboard

The main content or body of the note.

Link copied to clipboard
val id: Int = 0

The unique identifier for the note. It's the primary key and is auto-generated by Room. Defaults to 0, which Room interprets as "not set" for auto-generation purposes.

Link copied to clipboard
val isDeleted: Boolean = false

A flag indicating whether the note has been "soft-deleted". false means the note is active, true means it's considered deleted (but still in the DB). Defaults to false.

Link copied to clipboard

The time when the note was created or last modified, stored as milliseconds since epoch. Defaults to the current system time when a new Note object is instantiated.

Link copied to clipboard

The title of the note.