Created
February 7, 2019 07:29
-
-
Save CesarValiente/79680ab96f1accc1225d388520eb12bd 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
import com.cesarvaliente.kunidirectional.persistence.Color as PersistenceColor | |
import com.cesarvaliente.kunidirectional.store.Color as StoreColor | |
fun StoreColor.toPersistenceColor(): PersistenceColor = | |
when (this) { | |
StoreColor.BLUE -> PersistenceColor.BLUE | |
StoreColor.GREEN -> PersistenceColor.GREEN | |
StoreColor.RED -> PersistenceColor.RED | |
StoreColor.WHITE -> PersistenceColor.WHITE | |
StoreColor.YELLOW -> PersistenceColor.YELLOW | |
} | |
fun PersistenceColor.toStoreColor(): StoreColor = | |
when (this) { | |
PersistenceColor.BLUE -> StoreColor.BLUE | |
PersistenceColor.GREEN -> StoreColor.GREEN | |
PersistenceColor.RED -> StoreColor.RED | |
PersistenceColor.WHITE -> StoreColor.WHITE | |
PersistenceColor.YELLOW -> StoreColor.YELLOW | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment