Skip to content

Instantly share code, notes, and snippets.

@CesarValiente
Last active February 6, 2019 06:44
Show Gist options
  • Save CesarValiente/ded40c351bf3ae0af75e392d58cac91f to your computer and use it in GitHub Desktop.
Save CesarValiente/ded40c351bf3ae0af75e392d58cac91f to your computer and use it in GitHub Desktop.
enum class Color {
RED, YELLOW, GREEN, BLUE, WHITE
}
data class Item(
val localId: String = generateLocalId(),
val text: String? = null,
val favorite: Boolean = false,
val color: Color = Color.WHITE,
val position: Long = object : PositionsFactory {}.newPosition()) {
fun isEmpty(): Boolean = text == null
fun isNotEmpty(): Boolean = !isEmpty()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment