Last active
February 9, 2017 00:51
-
-
Save yemyatthu1990/5029cba4ef46078113f474457f668633 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TownshipDataRepository implements TownshipRepository{ | |
private final TownshipDataStoreFactory townshipDataStoreFactory; | |
private final TownshipMapper townshipMapper; | |
public TownshipDataRepository(TownshipDataStoreFactory townshipDataStoreFactory,TownshipMapper townshipMapper){ | |
this.townshipDataStoreFactory = townshipDataStoreFactory; | |
this.townshipMapper = townshipMapper; | |
} | |
@Override | |
public Observable<List<Township>> townships() { | |
return townshipDataStoreFactory.create().townships().map(new Function<List<TownshipEntity>, List<Township>>() { | |
@Override | |
public List<Township> apply(List<TownshipEntity> townshipEntities) throws Exception { | |
return townshipMapper.transformList(townshipEntities); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment