package joynr;

/*
 * #%L
 * %%
 * Copyright (C) 2011 - 2013 BMW Car IT GmbH
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

/**
 * Value class for the response of a JSON-RPC function call.
 */
public class Reply implements JoynrMessageType {
    private Object response;
    private String requestReplyId;

    public Reply() {
    }

    public Reply(String requestReplyId, Object response) {
        this.requestReplyId = requestReplyId;
        this.response = response;
    }

    public Object getResponse() {
        return response;
    }

    public String getRequestReplyId() {
        return requestReplyId;
    }

    @Override
    public String toString() {
        return "Reply: " + "requestReplyId: " + requestReplyId + ", response: " + response;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;

        Reply other = (Reply) obj;

        // always non null
        if (!requestReplyId.equals(other.requestReplyId)) {
            return false;
        }

        // always non-null
        if (!response.equals(other.response)) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((requestReplyId == null) ? 0 : requestReplyId.hashCode());
        result = prime * result + ((response == null) ? 0 : response.hashCode());
        return result;
    }
}

@@ -52,17 +52,17 @@
 11 - 201
-3
+5
  BMW Car
@@ -646,16 +646,60 @@
 L%25%0A */%0A%0A
+import io.joynr.exceptions.JoynrException;%0A%0A
 /**%0A * V
@@ -833,24 +833,58 @@
 t response;%0A
+    private JoynrException error;%0A
     private 
@@ -1096,54 +1096,267 @@
 lic 
-Object getResponse() %7B%0A        return response
+Reply(String requestReplyId, JoynrException error) %7B%0A        this.requestReplyId = requestReplyId;%0A        this.error = error;%0A    %7D%0A%0A    public Object getResponse() %7B%0A        return response;%0A    %7D%0A%0A    public JoynrException getError() %7B%0A        return error
 ;%0A  
@@ -1565,32 +1565,54 @@
 se: %22 + response
+ + %22, error: %22 + error
 ;%0A    %7D%0A%0A    @Ov
@@ -1682,16 +1682,18 @@
  == obj)
+ %7B
 %0A       
@@ -1706,24 +1706,34 @@
 eturn true;%0A
+        %7D%0A
         if (
@@ -1744,16 +1744,18 @@
 == null)
+ %7B
 %0A       
@@ -1765,32 +1765,42 @@
   return false;%0A
+        %7D%0A
         if (getC
@@ -1824,16 +1824,18 @@
 Class())
+ %7B
 %0A       
@@ -1853,16 +1853,25 @@
  false;%0A
+        %7D
 %0A       
@@ -1902,43 +1902,349 @@
 bj;%0A
-%0A        // always non null%0A       
+        if (error == null) %7B%0A            if (other.error != null) %7B%0A                return false;%0A            %7D%0A        %7D else if (!error.equals(other.error)) %7B%0A            return false;%0A        %7D%0A        if (requestReplyId == null) %7B%0A            if (other.requestReplyId != null) %7B%0A                return false;%0A            %7D%0A        %7D else
  if 
@@ -2328,25 +2328,24 @@
       %7D%0A
-%0A
         
 // alway
@@ -2340,26 +2340,73 @@
     
-// always non-
+if (response == null) %7B%0A            if (other.response != 
 null
+) %7B
 %0A   
@@ -2406,24 +2406,75 @@
 ) %7B%0A        
+        return false;%0A            %7D%0A        %7D else 
 if (!respons
@@ -2533,25 +2533,24 @@
 ;%0A        %7D%0A
-%0A
         retu
@@ -2661,16 +2661,92 @@
 lt = 1;%0A
+        result = prime * result + ((error == null) ? 0 : error.hashCode());%0A
         

add JoynrException field to Reply object