/**
 * Copyright 2010 OpenEngSB Division, Vienna University of Technology
 *
 * 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.
 */

package org.openengsb.core.common.communication;

import java.util.Map;

public class MethodReturn {
    public enum ReturnType {
            Object, Exception,
    }

    private ReturnType type;
    private Object arg;
    private Map<String, String> metaData;

    public MethodReturn(ReturnType type, Object arg, Map<String, String> metaData) {
        this.type = type;
        this.arg = arg;
        this.metaData = metaData;
    }

    public MethodReturn() {
    }

    public ReturnType getType() {
        return this.type;
    }

    public void setType(ReturnType type) {
        this.type = type;
    }

    public Object getArg() {
        return this.arg;
    }

    public void setArg(Object arg) {
        this.arg = arg;
    }

    public Map<String, String> getMetaData() {
        return this.metaData;
    }

    public void setMetaData(Map<String, String> metaData) {
        this.metaData = metaData;
    }

}

@@ -1560,10 +1560,1326 @@
 %0A    %7D%0A%0A
+    @Override%0A    public int hashCode() %7B%0A        final int prime = 31;%0A        int result = 1;%0A        result = prime * result + ((this.arg == null) ? 0 : this.arg.hashCode());%0A        result = prime * result + ((this.metaData == null) ? 0 : this.metaData.hashCode());%0A        result = prime * result + ((this.type == null) ? 0 : this.type.hashCode());%0A        return result;%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object obj) %7B%0A        if (this == obj) %7B%0A            return true;%0A        %7D%0A        if (obj == null) %7B%0A            return false;%0A        %7D%0A        if (getClass() != obj.getClass()) %7B%0A            return false;%0A        %7D%0A        MethodReturn other = (MethodReturn) obj;%0A        if (this.arg == null) %7B%0A            if (other.arg != null) %7B%0A                return false;%0A            %7D%0A        %7D else if (!this.arg.equals(other.arg)) %7B%0A            return false;%0A        %7D%0A        if (this.metaData == null) %7B%0A            if (other.metaData != null) %7B%0A                return false;%0A            %7D%0A        %7D else if (!this.metaData.equals(other.metaData)) %7B%0A            return false;%0A        %7D%0A        if (this.type != other.type) %7B%0A            return false;%0A        %7D%0A        return true;%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return String.format(%22%25s: %25s%22, type, arg);%0A    %7D%0A%0A
 %7D%0A

add equals and toString to MethodReturn