Created
November 6, 2017 23:20
-
-
Save jonathanrz/ba2039d83c8ce94248f4579d8f0f93a2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| interface DataSource { | |
| fun all(): List<Data> | |
| fun save(data: Data): Boolean | |
| } | |
| class DataRepository(val dao: DataDao) : DataSource { | |
| override fun all(): List<Data> = dao.all() | |
| override fun save(data: Data): Boolean = dao.save(data) != 0L | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment