2019-11-18 23:51:27 +01:00
|
|
|
package org.mercury_im.messenger.data.repository;
|
2019-11-18 00:04:28 +01:00
|
|
|
|
2019-11-18 23:51:27 +01:00
|
|
|
import org.mercury_im.messenger.entity.Account;
|
2019-12-09 13:50:26 +01:00
|
|
|
import org.mercury_im.messenger.util.Optional;
|
2019-11-18 00:04:28 +01:00
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import io.reactivex.Completable;
|
|
|
|
import io.reactivex.Maybe;
|
|
|
|
import io.reactivex.Observable;
|
|
|
|
import io.reactivex.Single;
|
|
|
|
|
|
|
|
public interface AccountRepository {
|
|
|
|
|
|
|
|
Single<Account> insertAccount(Account account);
|
|
|
|
|
|
|
|
Observable<Optional<Account>> observeAccount(long accountId);
|
|
|
|
|
|
|
|
Maybe<Account> getAccount(long accountId);
|
|
|
|
|
|
|
|
Observable<Optional<Account>> observeAccountByAddress(String address);
|
|
|
|
|
|
|
|
Maybe<Account> getAccountByAddress(String address);
|
|
|
|
|
|
|
|
Observable<List<Account>> observeAllAccounts();
|
|
|
|
|
|
|
|
Single<Account> updateAccount(Account account);
|
|
|
|
|
|
|
|
Single<Account> upsertAccount(Account account);
|
|
|
|
|
|
|
|
Completable deleteAccount(Account account);
|
|
|
|
|
|
|
|
}
|