Revert attempt to builder-ify accountModel
This commit is contained in:
parent
939ce748ef
commit
3e03f8c630
|
@ -49,9 +49,8 @@ public class RoomAccountModel extends AbstractAccountModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RoomAccountModel setId(long id) {
|
public void setId(long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -52,7 +52,10 @@ public class IAccountRepository implements AccountRepository<RoomAccountModel> {
|
||||||
@Override
|
@Override
|
||||||
public Single<Long> insertAccount(@NonNull RoomAccountModel accountModel) {
|
public Single<Long> insertAccount(@NonNull RoomAccountModel accountModel) {
|
||||||
return accountDao.insert(accountModel)
|
return accountDao.insert(accountModel)
|
||||||
.map(accountId -> accountModel.setId(accountId).getId())
|
.map(accountId -> {
|
||||||
|
accountModel.setId(accountId);
|
||||||
|
return accountId;
|
||||||
|
})
|
||||||
.doOnSubscribe(ignore -> Log.v(TAG, "Insert " + accountModel))
|
.doOnSubscribe(ignore -> Log.v(TAG, "Insert " + accountModel))
|
||||||
.doAfterSuccess(accountId -> Log.v(TAG, "AccountModel has new ID " + accountId));
|
.doAfterSuccess(accountId -> Log.v(TAG, "AccountModel has new ID " + accountId));
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ public interface AccountModel {
|
||||||
*
|
*
|
||||||
* @param id account id
|
* @param id account id
|
||||||
*/
|
*/
|
||||||
AccountModel setId(long id);
|
void setId(long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the password of the XMPP account.
|
* Return the password of the XMPP account.
|
||||||
|
|
Loading…
Reference in New Issue