Skip to content

Instantly share code, notes, and snippets.

@CesarValiente
Created February 6, 2019 06:55
Show Gist options
  • Save CesarValiente/bae25ac9ea316530408cdec79ac1d5f0 to your computer and use it in GitHub Desktop.
Save CesarValiente/bae25ac9ea316530408cdec79ac1d5f0 to your computer and use it in GitHub Desktop.
@RealmClass
open class Item() : RealmModel {
constructor(localId: String, text: String?, favorite: Boolean = false,
colorEnum: Color = Color.WHITE, position: Long) : this() {
this.localId = localId
this.text = text
this.favorite = favorite
this.color = colorEnum.name
this.position = position
}
@PrimaryKey open var localId: String = ""
open var text: String? = null
open var favorite: Boolean = false
@Ignore private var colorEnum: Color = Color.WHITE
open var color: String = colorEnum.name
open var position: Long = 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment