package com.backendless.servercode;

import com.backendless.commons.exception.ExceptionWrapper;

/**
 * Created with IntelliJ IDEA.
 * User: ivanlappo
 * Date: 10/3/13
 * Time: 6:28 PM
 * To change this template use File | Settings | File Templates.
 */
public class ExecutionResult<T>
{
  private T result;
  private byte[] arguments;
  private ExceptionWrapper exception;

  public ExecutionResult()
  {
  }

  public ExecutionResult( T result )
  {
    this.result = result;
  }

  public ExecutionResult( T res, Exception exception )
  {
    this.result = res;
    if( exception != null )
      this.exception = new ExceptionWrapper( exception );
  }

  public ExecutionResult( T result, byte[] arguments, ExceptionWrapper exception )
  {
    this.result = result;
    this.arguments = arguments;
    this.exception = exception;
  }

  public ExceptionWrapper getException()
  {
    return exception;
  }

  public T getResult()
  {
    return result;
  }

  public void setResult( T result )
  {
    this.result = result;
  }

  public void setException( ExceptionWrapper exception )
  {
    this.exception = exception;
  }

  public byte[] getArguments()
  {
    return arguments;
  }

  public void setArguments( byte[] arguments )
  {
    this.arguments = arguments;
  }

  @Override
  public String toString()
  {
    return "ExecutionResult{" +
            "result=" + result +
            ", exception=" + exception +
            '}';
  }
}

@@ -305,36 +305,8 @@
 lt;%0A
-  private byte%5B%5D arguments;%0A
   pr
@@ -660,26 +660,8 @@
 ult,
- byte%5B%5D arguments,
  Exc
@@ -720,40 +720,8 @@
 lt;%0A
-    this.arguments = arguments;%0A
     
@@ -1047,328 +1047,7 @@
 %0A  %7D
-%0A%0A  public byte%5B%5D getArguments()%0A  %7B%0A    return arguments;%0A  %7D%0A%0A  public void setArguments( byte%5B%5D arguments )%0A  %7B%0A    this.arguments = arguments;%0A  %7D%0A%0A  @Override%0A  public String toString()%0A  %7B%0A    return %22ExecutionResult%7B%22 +%0A            %22result=%22 + result +%0A            %22, exception=%22 + exception +%0A            '%7D';%0A  %7D
 %0A%7D%0A

remove argument field from execution result. Real argument synchronized automatically