Back to project page cube-sdk.
The source code is released under:
Apache License
If you think the Android project cube-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package in.srain.cube.request; /*www .j av a 2 s .c o m*/ /** * @author http://www.liaohuqiu.net */ public class SimpleRequest<T> extends RequestBase<T> implements IRequest<T> { private RequestHandler<T> mRequestHandler; public SimpleRequest() { } public SimpleRequest(RequestHandler<T> handler) { setRequestHandler(handler); } public SimpleRequest setRequestHandler(RequestHandler<T> handler) { mRequestHandler = handler; return this; } @Override protected void doSendRequest() { SimpleRequestManager.sendRequest(this); } @Override protected void prepareRequest() { } @Override public void onRequestSuccess(T data) { if (null != mRequestHandler) { mRequestHandler.onRequestFinish(data); } } @Override public void onRequestFail(FailData failData) { if (null != mRequestHandler) { mRequestHandler.onRequestFail(failData); } } @Override public T processOriginDataFromServer(JsonData rawData) { if (null != mRequestHandler) { return mRequestHandler.processOriginData(rawData); } return null; } }