Created
December 2, 2020 16:11
-
-
Save BuiVanNam/3e0e6732e44a77b1690f4ad1f7c62411 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by nambv on 11/18/2020 | |
*/ | |
sealed class EventItemBook { | |
data class AddFavoriteBook(val book: Book) : EventItemBook() | |
data class RemoveFavoriteBook(val book: Book) : EventItemBook() | |
data class ActionOpenBook(val book: Book) : EventItemBook() | |
data class OpenMenuBook(val book: Book) : EventItemBook() | |
override fun toString(): String { | |
return when (this) { | |
is AddFavoriteBook -> "AddFavoriteBook[book: $book]" | |
is RemoveFavoriteBook -> "RemoveFavoriteBook[book: $book]" | |
is ActionOpenBook -> "ActionOpenBook[book: $book]" | |
is OpenMenuBook -> "OpenMenuBook[book: $book]" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment