Skip to content

Instantly share code, notes, and snippets.

@igorescodro
Created October 16, 2023 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igorescodro/469e4997082721085ec92c9652f8027a to your computer and use it in GitHub Desktop.
Save igorescodro/469e4997082721085ec92c9652f8027a to your computer and use it in GitHub Desktop.
val alarmIntervalAdapter = object : ColumnAdapter<AlarmInterval, Long> {
override fun decode(databaseValue: Long): AlarmInterval =
AlarmInterval.values().find { it.id == databaseValue.toInt() }!!
override fun encode(value: AlarmInterval): Long =
value.id.toLong()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment