001    /*
002     * Copyright 2009 The Kuali Foundation Licensed under the Educational Community
003     * License, Version 1.0 (the "License"); you may not use this file except in
004     * compliance with the License. You may obtain a copy of the License at
005     * http://www.opensource.org/licenses/ecl1.php Unless required by applicable law
006     * or agreed to in writing, software distributed under the License is
007     * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
008     * KIND, either express or implied. See the License for the specific language
009     * governing permissions and limitations under the License.
010     */
011    package org.kuali.student.enrollment.lpr.dto;
012    
013    import java.io.Serializable;
014    import java.util.ArrayList;
015    import java.util.List;
016    
017    import javax.xml.bind.annotation.XmlAccessType;
018    import javax.xml.bind.annotation.XmlAccessorType;
019    import javax.xml.bind.annotation.XmlAnyElement;
020    import javax.xml.bind.annotation.XmlElement;
021    import javax.xml.bind.annotation.XmlType;
022    
023    import org.kuali.student.enrollment.lpr.infc.Lpr;
024    import org.kuali.student.r2.common.dto.RelationshipInfo;
025    import org.w3c.dom.Element;
026    
027    @XmlAccessorType(XmlAccessType.FIELD)
028    @XmlType(name = "LprInfo", propOrder = {"id", "typeKey", "stateKey", "luiId", "personId",
029            "resultValuesGroupKeys", "commitmentPercent", "effectiveDate", "expirationDate", "meta", "attributes",
030            "_futureElements"})
031    public class LprInfo extends RelationshipInfo implements Lpr, Serializable {
032    
033        private static final long serialVersionUID = 1L;
034    
035        @XmlElement
036        private String luiId;
037    
038        @XmlElement
039        private String personId;
040    
041        @XmlElement
042        private List<String> resultValuesGroupKeys;
043    
044        @XmlElement
045        private String commitmentPercent;
046    
047        @XmlAnyElement
048        private List<Element> _futureElements;
049    
050        public LprInfo() {
051        }
052    
053        public LprInfo(Lpr lpr) {
054            super(lpr);
055            if (lpr != null) {
056                this.luiId = lpr.getLuiId();
057                this.personId = lpr.getPersonId();
058                this.commitmentPercent = lpr.getCommitmentPercent();
059                if (lpr.getResultValuesGroupKeys() != null) {
060                    this.resultValuesGroupKeys = new ArrayList<String>(lpr.getResultValuesGroupKeys());
061                }
062            }
063        }
064    
065        @Override
066        public String getLuiId() {
067            return luiId;
068        }
069    
070        public void setLuiId(String luiId) {
071            this.luiId = luiId;
072        }
073    
074        @Override
075        public String getPersonId() {
076            return personId;
077        }
078    
079        public void setPersonId(String personId) {
080            this.personId = personId;
081        }
082    
083        @Override
084        public String getCommitmentPercent() {
085            return commitmentPercent;
086        }
087    
088        public void setCommitmentPercent(String commitmentPercent) {
089            this.commitmentPercent = commitmentPercent;
090        }
091    
092        @Override
093        public List<String> getResultValuesGroupKeys() {
094            if (this.resultValuesGroupKeys == null) {
095                this.resultValuesGroupKeys = new ArrayList<String>();
096            }
097            return resultValuesGroupKeys;
098        }
099    
100        public void setResultValuesGroupKeys(List<String> resultValuesGroupKeys) {
101            this.resultValuesGroupKeys = resultValuesGroupKeys;
102        }
103    
104            @Override
105            public String toString() {
106                    StringBuilder builder = new StringBuilder();
107                    builder.append("LprInfo [id=");
108                    builder.append(getId());
109                    builder.append(", type=");
110                    builder.append(getTypeKey());
111                    builder.append(", state=");
112                    builder.append(getStateKey());
113                    builder.append(", luiId=");
114                    builder.append(luiId);
115                    builder.append(", personId=");
116                    builder.append(personId);
117                    builder.append(", commitmentPercent=");
118                    builder.append(commitmentPercent);
119                    builder.append("]");
120                    return builder.toString();
121            }
122        
123        
124    }