com.savl.ripple.client.requests.Operation Maven / Gradle / Ivy
package com.savl.ripple.client.requests;
import com.savl.ripple.client.async.ComposedOperation;
import com.savl.ripple.client.responses.Response;
import org.json.JSONException;
public class Operation extends Request.Manager {
public int nth;
public ComposedOperation composed;
public Operation(int nth, ComposedOperation composed) {
this.nth = nth;
this.composed = composed;
}
@Override
public void beforeRequest(Request r) {
super.beforeRequest(r);
}
@Override
public boolean retryOnUnsuccessful(Response r) {
return super.retryOnUnsuccessful(r);
}
@SuppressWarnings("unchecked")
@Override
public void cb(Response response, T t) throws JSONException {
switch (nth) {
case 1:
composed.first(t);
break;
case 2:
composed.second(t);
break;
case 3:
composed.third(t);
break;
case 4:
composed.fourth(t);
break;
}
}
}