package com.eactive.eai.transformer.engine;

import java.util.ArrayList;
import java.util.List;

import com.eactive.eai.transformer.message.Message;

public class TransformResult {
    private List warningList;
    private Message resultMessage;
    private Message[] sourceMessages;
    private TransformOption option;

    TransformResult() {
    }

    public boolean hasWarning() {
        return (warningList != null);
    }

    public List getWarningList() {
        return warningList;
    }

    void addWarning(TransformWarning warning) {
        if (warningList == null) {
            warningList = new ArrayList();
        }

        warningList.add(warning);
    }

    public Object getResultData() throws Exception {
        return resultMessage.getData();
    }

    public Message getResultMessage() {
        return resultMessage;
    }

    void setResultMessage(Message message) {
        this.resultMessage = message;
    }

    public Message[] getSourceMessages() {
        return sourceMessages;
    }

    void setSourceMessages(Message[] messages) {
        this.sourceMessages = messages;
    }

    public TransformOption getOption() {
        return option;
    }

    void setTransformOption(TransformOption option) {
        this.option = option;
    }
}
