33 lines
858 B
Java
33 lines
858 B
Java
package org.mercury_im.messenger.core.repository;
|
|
|
|
import org.mercury_im.messenger.core.entity.contact.Contact;
|
|
import org.mercury_im.messenger.core.util.Optional;
|
|
|
|
import java.util.List;
|
|
|
|
import io.reactivex.Completable;
|
|
import io.reactivex.Maybe;
|
|
import io.reactivex.Observable;
|
|
import io.reactivex.Single;
|
|
|
|
public interface ContactRepository {
|
|
|
|
Single<Contact> insertContact(Contact contact);
|
|
|
|
Observable<Optional<Contact>> observeContact(long contactId);
|
|
|
|
Maybe<Contact> getContact(long contactId);
|
|
|
|
Observable<Optional<Contact>> observeContactByAddress(String address);
|
|
|
|
Maybe<Contact> getContactByAddress(String address);
|
|
|
|
Observable<List<Contact>> observeAllContacts();
|
|
|
|
Single<Contact> updateContact(Contact contact);
|
|
|
|
Single<Contact> upsertContact(Contact contact);
|
|
|
|
Completable deleteContact(Contact contact);
|
|
}
|