001/**
002 * Copyright 2005-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krms.dto;
017
018import org.kuali.rice.krms.api.repository.proposition.PropositionParameterContract;
019
020import java.io.Serializable;
021import org.kuali.rice.krms.api.repository.term.TermDefinition;
022
023/**
024 * @author Kuali Student Team
025 */
026public class PropositionParameterEditor implements PropositionParameterContract, Serializable {
027
028    private String id;
029    private String propId;
030    private String value;
031    private TermDefinition termValue;
032    private String parameterType;
033    private Integer sequenceNumber;
034    private Long versionNumber;
035
036    public PropositionParameterEditor(){
037        super();
038    }
039
040    public PropositionParameterEditor(String parameterType, Integer sequenceNumber){
041        super();
042        this.setParameterType(parameterType);
043        this.setSequenceNumber(sequenceNumber);
044        this.setVersionNumber(Long.valueOf(1));
045        this.setValue(null);
046        this.setTermValue(null);
047    }
048
049    /**
050     * Converts a immutable object to it's mutable bo counterpart
051     * @param definition immutable object
052     * @return the mutable bo
053     */
054    public PropositionParameterEditor(PropositionParameterContract definition) {
055        this.id = definition.getId();
056        this.propId = definition.getPropId();
057        this.value = definition.getValue();
058        this.termValue = definition.getTermValue();
059        this.parameterType = definition.getParameterType();
060        this.sequenceNumber = definition.getSequenceNumber();
061        this.versionNumber = definition.getVersionNumber();
062    }
063
064    public void clear() {
065        this.value = null;
066    }
067
068    public void setId(String id) {
069        this.id = id;
070    }
071
072    @Override
073    public String getId() {
074        return id;
075    }
076
077    public void setPropId(String propId) {
078        this.propId = propId;
079    }
080
081    @Override
082    public String getPropId() {
083        return propId;
084    }
085
086    public void setValue(String value) {
087        this.value = value;
088    }
089
090    @Override
091    public String getValue() {
092        return value;
093    }
094
095    public void setTermValue(TermDefinition termValue) {
096        this.termValue = termValue;
097    }
098
099    @Override
100    public TermDefinition getTermValue() {
101        return termValue;
102    }
103
104    
105    
106    public void setParameterType(String parameterType) {
107        this.parameterType = parameterType;
108    }
109
110    @Override
111    public String getParameterType() {
112        return parameterType;
113    }
114
115    public void setSequenceNumber(Integer sequenceNumber) {
116        this.sequenceNumber = sequenceNumber;
117    }
118
119    @Override
120    public Integer getSequenceNumber() {
121        return sequenceNumber;
122    }
123
124    @Override
125    public Long getVersionNumber() {
126        return versionNumber;
127    }
128
129    public void setVersionNumber(Long versionNumber) {
130        this.versionNumber = versionNumber;
131    }
132
133}