// Path: android-rest-lib/src/main/java/com/dg/libs/rest/callbacks/HttpCallback.java
// public interface HttpCallback<T> {
// 
//   /**
//    * This method shows that the callback successfully finished. It contains
//    * response data which represents the return type of the callback.
//    * 
//    * @param responseData
//    *          It can be of any type.
//    */
//   void onSuccess(T responseData, ResponseStatus responseStatus);
// 
//   /**
//    * This method shows that the callback has failed due to server issue, no
//    * connectivity or parser error
//    * 
//    * @param responseStatus
//    */
//   void onHttpError(ResponseStatus responseStatus);
// 
// }
// 
// Path: android-rest-lib/src/main/java/com/dg/libs/rest/domain/ResponseStatus.java
// public class ResponseStatus {
// 
//   public static final String TAG = ResponseStatus.class.getSimpleName();
// 
//   private int statusCode;
//   private String statusMessage;
// 
//   public ResponseStatus(int statusCode, String statusMessage) {
//     this.statusCode = statusCode;
//     this.statusMessage = statusMessage;
//   }
// 
//   public ResponseStatus() {
//   }
// 
//   public int getStatusCode() {
//     return statusCode;
//   }
// 
//   public void setStatusCode(int statusCode) {
//     this.statusCode = statusCode;
//   }
// 
//   public String getStatusMessage() {
//     return statusMessage;
//   }
// 
//   public void setStatusMessage(String statusMessage) {
//     this.statusMessage = statusMessage;
//   }
// 
//   public static ResponseStatus getConnectionErrorStatus() {
//     ResponseStatus status = new ResponseStatus();
//     status.setStatusCode(HttpStatus.SC_REQUEST_TIMEOUT);
//     status.setStatusMessage("HTTP Connection Error");
//     return status;
//   }
// 
//   public static ResponseStatus getParseErrorStatus() {
//     ResponseStatus status = new ResponseStatus();
//     status.setStatusCode(HttpStatus.SC_BAD_REQUEST);
//     status.setStatusMessage("Parser Error");
//     return status;
//   }
// 
//   @Override
//   public String toString() {
//     StringBuilder builder = new StringBuilder();
//     builder.append("ResponseStatus [statusCode=");
//     builder.append(statusCode);
//     builder.append(", statusMessage=");
//     builder.append(statusMessage);
//     builder.append("]");
//     return builder.toString();
//   }
// 
// }


import android.os.Handler;
import android.os.Looper;
import com.dg.libs.rest.callbacks.HttpCallback;
import com.dg.libs.rest.domain.ResponseStatus;
package com.dg.libs.rest.handlers;


public class UIThreadResponseHandler<T> extends BackgroundThreadResponseHandler<T>
    implements ResponseHandler<T> {

  public static final String TAG = UIThreadResponseHandler.class.getSimpleName();
  protected static Handler handler;

// Path: android-rest-lib/src/main/java/com/dg/libs/rest/callbacks/HttpCallback.java
// public interface HttpCallback<T> {
// 
//   /**
//    * This method shows that the callback successfully finished. It contains
//    * response data which represents the return type of the callback.
//    * 
//    * @param responseData
//    *          It can be of any type.
//    */
//   void onSuccess(T responseData, ResponseStatus responseStatus);
// 
//   /**
//    * This method shows that the callback has failed due to server issue, no
//    * connectivity or parser error
//    * 
//    * @param responseStatus
//    */
//   void onHttpError(ResponseStatus responseStatus);
// 
// }
// 
// Path: android-rest-lib/src/main/java/com/dg/libs/rest/domain/ResponseStatus.java
// public class ResponseStatus {
// 
//   public static final String TAG = ResponseStatus.class.getSimpleName();
// 
//   private int statusCode;
//   private String statusMessage;
// 
//   public ResponseStatus(int statusCode, String statusMessage) {
//     this.statusCode = statusCode;
//     this.statusMessage = statusMessage;
//   }
// 
//   public ResponseStatus() {
//   }
// 
//   public int getStatusCode() {
//     return statusCode;
//   }
// 
//   public void setStatusCode(int statusCode) {
//     this.statusCode = statusCode;
//   }
// 
//   public String getStatusMessage() {
//     return statusMessage;
//   }
// 
//   public void setStatusMessage(String statusMessage) {
//     this.statusMessage = statusMessage;
//   }
// 
//   public static ResponseStatus getConnectionErrorStatus() {
//     ResponseStatus status = new ResponseStatus();
//     status.setStatusCode(HttpStatus.SC_REQUEST_TIMEOUT);
//     status.setStatusMessage("HTTP Connection Error");
//     return status;
//   }
// 
//   public static ResponseStatus getParseErrorStatus() {
//     ResponseStatus status = new ResponseStatus();
//     status.setStatusCode(HttpStatus.SC_BAD_REQUEST);
//     status.setStatusMessage("Parser Error");
//     return status;
//   }
// 
//   @Override
//   public String toString() {
//     StringBuilder builder = new StringBuilder();
//     builder.append("ResponseStatus [statusCode=");
//     builder.append(statusCode);
//     builder.append(", statusMessage=");
//     builder.append(statusMessage);
//     builder.append("]");
//     return builder.toString();
//   }
// 
// }


// Path: android-rest-lib/src/main/java/com/dg/libs/rest/handlers/UIThreadResponseHandler.java
import android.os.Handler;
import android.os.Looper;
import com.dg.libs.rest.callbacks.HttpCallback;
import com.dg.libs.rest.domain.ResponseStatus;

package com.dg.libs.rest.handlers;


public class UIThreadResponseHandler<T> extends BackgroundThreadResponseHandler<T>
    implements ResponseHandler<T> {

  public static final String TAG = UIThreadResponseHandler.class.getSimpleName();
  protected static Handler handler;

  public UIThreadResponseHandler(HttpCallback<T> callback) {