Skip to content

Instantly share code, notes, and snippets.

@yemyatthu1990
Last active February 9, 2017 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yemyatthu1990/5029cba4ef46078113f474457f668633 to your computer and use it in GitHub Desktop.
Save yemyatthu1990/5029cba4ef46078113f474457f668633 to your computer and use it in GitHub Desktop.
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