Skip to content

Commit

Permalink
Upgrade implementation to new store2store lib 2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tspoke committed May 4, 2017
1 parent 3f69ce2 commit 7e4d770
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion store2realm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies {
})

compile "io.reactivex:rxandroid:1.2.1"
compile 'com.github.playmoweb:store2store:2.0.1'
compile 'com.github.playmoweb:store2store:2.0.4'

testCompile 'junit:junit:4.12'
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ public Observable<TestModel> getOne(Filter filter, SortingMode sortingMode) {
}

@Override
public Observable<TestModel> getById(String id) {
int integerId = Integer.valueOf(id);
public Observable<TestModel> getById(int id) {
TestModel t = null;
for(TestModel tm : models) {
if(tm.getId() == integerId) {
if(tm.getId() == id) {
t = tm;
break;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.playmoweb.store2realm.mock;

import com.playmoweb.store2realm.service.api.AbstractService;
import com.playmoweb.store2realm.utils.Filter;
import com.playmoweb.store2realm.utils.SortingMode;
import com.playmoweb.store2store.service.AbstractService;
import com.playmoweb.store2store.utils.Filter;
import com.playmoweb.store2store.utils.SortingMode;

import java.util.List;

Expand Down Expand Up @@ -38,7 +38,7 @@ protected Observable<TestModel> getOne(Filter filter, SortingMode sortingMode) {
}

@Override
protected Observable<TestModel> getById(String id) {
protected Observable<TestModel> getById(int id) {
return myCustomAPI.getById(id);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,6 @@ public final Observable<T> getOne(Filter filter, SortingMode sortingMode) {
* @return
*/
@Override
public Observable<T> getById(String id) {
return getOne(new Filter("id", id), null);
}

/**
* Get one by id
* @param id
* @return
*/
public Observable<T> getById(int id) {
return getOne(new Filter("id", id), null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected Observable<T> getOne(Filter filter, SortingMode sortingMode) {
}

@Override
protected Observable<T> getById(String id) {
protected Observable<T> getById(int id) {
return null;
}

Expand Down

0 comments on commit 7e4d770

Please sign in to comment.