001package org.kuali.rice.krms.dto;
002
003import org.kuali.rice.krms.api.repository.proposition.PropositionParameterContract;
004
005import java.io.Serializable;
006import org.kuali.rice.krms.api.repository.term.TermDefinition;
007
008/**
009 * Created with IntelliJ IDEA.
010 * User: SW
011 * Date: 2013/02/15
012 * Time: 10:29 AM
013 * To change this template use File | Settings | File Templates.
014 */
015public class PropositionParameterEditor implements PropositionParameterContract, Serializable {
016
017    private String id;
018    private String propId;
019    private String value;
020    private TermDefinition termValue;
021    private String parameterType;
022    private Integer sequenceNumber;
023    private Long versionNumber;
024
025    public PropositionParameterEditor(){
026        super();
027    }
028
029    public PropositionParameterEditor(String parameterType, Integer sequenceNumber){
030        super();
031        this.setParameterType(parameterType);
032        this.setSequenceNumber(sequenceNumber);
033        this.setVersionNumber(new Long(1));
034        this.setValue(null);
035        this.setTermValue(null);
036    }
037
038    /**
039     * Converts a immutable object to it's mutable bo counterpart
040     * @param definition immutable object
041     * @return the mutable bo
042     */
043    public PropositionParameterEditor(PropositionParameterContract definition) {
044        this.id = definition.getId();
045        this.propId = definition.getPropId();
046        this.value = definition.getValue();
047        this.termValue = definition.getTermValue();
048        this.parameterType = definition.getParameterType();
049        this.sequenceNumber = definition.getSequenceNumber();
050        this.versionNumber = definition.getVersionNumber();
051    }
052
053    public void setId(String id) {
054        this.id = id;
055    }
056
057    @Override
058    public String getId() {
059        return id;
060    }
061
062    public void setPropId(String propId) {
063        this.propId = propId;
064    }
065
066    @Override
067    public String getPropId() {
068        return propId;
069    }
070
071    public void setValue(String value) {
072        this.value = value;
073    }
074
075    @Override
076    public String getValue() {
077        return value;
078    }
079
080    public void setTermValue(TermDefinition termValue) {
081        this.termValue = termValue;
082    }
083
084    @Override
085    public TermDefinition getTermValue() {
086        return termValue;
087    }
088
089    
090    
091    public void setParameterType(String parameterType) {
092        this.parameterType = parameterType;
093    }
094
095    @Override
096    public String getParameterType() {
097        return parameterType;
098    }
099
100    public void setSequenceNumber(Integer sequenceNumber) {
101        this.sequenceNumber = sequenceNumber;
102    }
103
104    @Override
105    public Integer getSequenceNumber() {
106        return sequenceNumber;
107    }
108
109    @Override
110    public Long getVersionNumber() {
111        return versionNumber;
112    }
113
114    public void setVersionNumber(Long versionNumber) {
115        this.versionNumber = versionNumber;
116    }
117
118}