Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data class Credentials(val username: String, val password: String)
- interface ContactsApi {
- fun getContacts(credentials: Credentials): Flowable<SimpleContact>
- companion object {
- fun createFor(serverUrl: String) = object: ContactsApi {
- override fun getContacts(credentials: Credentials):
- Flowable<SimpleContact> {
- Log.i("ContactsApi",
- "Querying for contacts from $serverUrl with $credentials")
- return Flowable.just(
- SimpleContact("Contact1", isStarred = false),
- SimpleContact("Contact2", isStarred = false),
- SimpleContact("Contact3", isStarred = true)
- )
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment