package com.eactive.eai.transformer.transform;

import java.io.Serializable;

public class TransformItem implements Serializable {
	private static final long serialVersionUID = 1L;
	private Transform transform;
    private String resultItemPath;
    private String instruction;
    private String defaultValue;
    private int seqNo;

    public TransformItem() {
    	super();
    }

    public void setTransform(Transform transform) {
        this.transform = transform;
    }

    public Transform getTransform() {
        return this.transform;
    }

    public void setResultItemPath(String resultItemPath) {
        this.resultItemPath = resultItemPath;
    }

    public String getResultItemPath() {
        return this.resultItemPath;
    }

    public void setInstruction(String instruction) {
        this.instruction = instruction;
    }

    public String getInstruction() {
        return this.instruction;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public String getDefaultValue() {
        return this.defaultValue;
    }
    
    public void setSeqNo(int seqNo) {
        this.seqNo = seqNo;
    }
    
    public int getSeqNo() {
        return this.seqNo;
    }

    public String toString(String tab) {
    	StringBuilder sb = new StringBuilder();
        sb.append(tab);
        sb.append("TransformItem : ");
        sb.append(resultItemPath);
        sb.append(" = ").append(instruction);
        
        /**
         * default value
         */
        if (defaultValue != null && !"".equals(defaultValue)) {
        	sb.append("(default='").append(defaultValue).append("')");
        }

        return sb.toString();
    }

    public String toString() {
        return toString("");
    }
}
