com.peersafe.base.client.requests.Operation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chainsql Show documentation
Show all versions of chainsql Show documentation
ChainSQL JAVA API is an api for chainsql server
The newest version!
package com.peersafe.base.client.requests;
import com.peersafe.base.client.async.ComposedOperation;
import com.peersafe.base.client.responses.Response;
import org.json.JSONException;
public class Operation extends Request.Manager {
public int nth;
public ComposedOperation composed;
/**
* Operation
* @param nth nth
* @param composed 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;
}
}
}