package com.stanfy.serverapi.response;

import android.util.Log;

import com.stanfy.serverapi.ErrorCodes;


/**
 * Response data that is passed to service callbacks.
 * @param <T> model type
 * @author Roman Mazur - Stanfy (http://www.stanfy.com)
 */
public class ResponseData<T>  {

  /** Error code. */
  private int errorCode;
  /** Message. */
  private String message;
  /** Model. */
  private T model;

  public ResponseData() {
    // nothing
  }
  public ResponseData(final T model) {
    this.model = model;
  }

  /** @return serializable model */
  public T getModel() { return model; }
  /** @return the errorCode */
  public int getErrorCode() { return errorCode; }
  /** @return the message */
  public String getMessage() { return message; }

  /** @param errorCode the errorCode to set */
  public void setErrorCode(final int errorCode) {
    this.errorCode = errorCode;
    if (errorCode == ErrorCodes.ERROR_CODE_SERVER_COMUNICATION) {
      Log.e("123123", "aaaaaaa", new Throwable());
    }
  }
  /** @param message the message to set */
  public void setMessage(final String message) { this.message = message; }
  /** @param model the model to set */
  public void setModel(final T model) { this.model = model; }

  /** @return success flag */
  public boolean isSuccessful() { return errorCode == 0; }

}

@@ -39,77 +39,8 @@
 %0D%0A%0D%0A
-import android.util.Log;%0D%0A%0D%0Aimport com.stanfy.serverapi.ErrorCodes;%0D%0A
 %0D%0A%0D%0A
@@ -854,134 +854,8 @@
 e;%0D%0A
-    if (errorCode == ErrorCodes.ERROR_CODE_SERVER_COMUNICATION) %7B%0D%0A      Log.e(%22123123%22, %22aaaaaaa%22, new Throwable());%0D%0A    %7D%0D%0A
   %7D%0D

remove test logging