Skip to content

Instantly share code, notes, and snippets.

@MBratkowski
Last active November 23, 2016 20:12
Show Gist options
  • Save MBratkowski/44bf0eb89c29edc4694c1237a116ec2f to your computer and use it in GitHub Desktop.
Save MBratkowski/44bf0eb89c29edc4694c1237a116ec2f to your computer and use it in GitHub Desktop.
FOWS Gits
package com.fows.entiti.gateway;
import com.fows.entiti.Prelegent;
import com.fows.entiti.Presentation;
import com.fows.entiti.Sponsor;
import java.util.List;
/**
* Created by mateusz.bratkowski on 13/11/16.
*/
public interface EntitiGateway {
//FIXME Here should return a Single RxObject
List<Prelegent> getPrelegenst();
List<Presentation> getPresentations();
List<Sponsor> getSponsors();
Sponsor getSponsor(int sponsor);
Prelegent getPrelegent(int prelegentId);
Presentation getPresentation(int presentationdId);
void updatePresentationLikeState(int presentationId, boolean isLiked);
void updatePresentationRaiting(int presentationdId, float rating);
}
package data.json;
import com.fows.entiti.Prelegent;
import com.fows.entiti.Presentation;
import com.fows.entiti.Sponsor;
import com.fows.entiti.gateway.EntitiGateway;
import java.util.List;
/**
* Created by mateusz.bratkowski on 13/11/16.
*/
public class JsonProvider implements EntitiGateway {
@Override
public List<Prelegent> getPrelegenst() {
return null;
}
@Override
public List<Presentation> getPresentations() {
return null;
}
@Override
public List<Sponsor> getSponsors() {
return null;
}
@Override
public Sponsor getSponsor(int sponsor) {
return null;
}
@Override
public Prelegent getPrelegent(int prelegentId) {
return null;
}
@Override
public Presentation getPresentation(int presentationdId) {
return null;
}
@Override
public void updatePresentationLikeState(int presentationId, boolean isLiked) {
}
@Override
public void updatePresentationRaiting(int presentationdId, float rating) {
}
}
entityGateway.getPrelegents().compose(observerTransformer.<List<Prelegent>>applySchedulers())
.subscribe(new Subscriber<List<Prelegent>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable error) {
callback.onError(error);
}
@Override
public void onNext(List<Prelegent> prelegents) {
callback.onSuccess(prelegents);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment