What do these annotations mean in this Kotlin code in android?
@SuppressLint("SimpleDateFormat")
fun convertLongToDateString(systemTime: Long): String {
return SimpleDateFormat("EEEE MMM-dd-yyyy' Time: 'HH:mm")
.format(systemTime).toString()
}
@Entity(tablename = "daily_sleep_quality_table")
data class SleepNight(...)
....
....
@ is a Java annotation, which also supported in Kotlin.
@SuppressLint("SimpleDateFormat")
@SuppressLint is an annotation used by the Android Lint tool. Lint will tell you whenever something in your code isn't optimal or may crash. By passing "SimpleDateFormat" there, you're suppressing all warnings that would tell you if you're using SimpleDateFormat in a wrong way.
@Entity(tablename = "daily_sleep_quality_table")
@Entity is annotation used by SQLite to marks a class as an Entity. If your using that in your class, SQLite will identify your class as an Entity with the specified table name.