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
|
||||
public RoomAccountModel setId(long id) {
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -52,7 +52,10 @@ public class IAccountRepository implements AccountRepository<RoomAccountModel> {
|
|||
@Override
|
||||
public Single<Long> insertAccount(@NonNull RoomAccountModel 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))
|
||||
.doAfterSuccess(accountId -> Log.v(TAG, "AccountModel has new ID " + accountId));
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public interface AccountModel {
|
|||
*
|
||||
* @param id account id
|
||||
*/
|
||||
AccountModel setId(long id);
|
||||
void setId(long id);
|
||||
|
||||
/**
|
||||
* Return the password of the XMPP account.
|
||||
|
|
Loading…
Reference in New Issue