001/**
002 * Copyright 2014 The Kuali Foundation Licensed under the
003 * Educational Community License, Version 2.0 (the "License"); you may
004 * not use this file except in compliance with the License. You may
005 * obtain a copy of the License at
006 *
007 * http://www.osedu.org/licenses/ECL-2.0
008 *
009 * Unless required by applicable law or agreed to in writing,
010 * software distributed under the License is distributed on an "AS IS"
011 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
012 * or implied. See the License for the specific language governing
013 * permissions and limitations under the License.
014 *
015 * Created by venkat on 7/28/14
016 */
017package org.kuali.student.cm.decision.form.wrapper;
018
019import org.kuali.student.r2.core.comment.dto.CommentInfo;
020
021/**
022 *
023 * @author Kuali Student Team
024 */
025public class CMDecisionWrapper implements Comparable<CMDecisionWrapper> {
026
027    private String actor;
028    private String decision;
029    private String date;
030    private String rationale;
031
032    protected CommentInfo comment;
033
034    public CMDecisionWrapper(){
035
036    }
037
038    public CMDecisionWrapper(CommentInfo comment){
039        this.comment = comment;
040    }
041
042    /**
043     * Gets the value of actor
044     *
045     * @return the value of actor
046     */
047    public String getActor() {
048        return this.actor;
049    }
050
051    /**
052     * Sets the value of actor
053     *
054     * @param argActor Value to assign to this.actor
055     */
056    public void setActor(final String argActor) {
057        this.actor = argActor;
058    }
059
060    /**
061     * Gets the value of decision
062     *
063     * @return the value of decision
064     */
065    public String getDecision() {
066        return this.decision;
067    }
068
069    /**
070     * Sets the value of decision
071     *
072     * @param argDecision Value to assign to this.decision
073     */
074    public void setDecision(final String argDecision) {
075        this.decision = argDecision;
076    }
077
078    /**
079     * Gets the value of date
080     *
081     * @return the value of date
082     */
083    public String getDate() {
084        return this.date;
085    }
086
087    /**
088     * Sets the value of date
089     *
090     * @param argDate Value to assign to this.date
091     */
092    public void setDate(final String argDate) {
093        this.date = argDate;
094    }
095
096    /**
097     * Gets the value of rationale
098     *
099     * @return the value of rationale
100     */
101    public String getRationale() {
102        return this.rationale;
103    }
104
105    /**
106     * Sets the value of rationale
107     *
108     * @param argRationale Value to assign to this.rationale
109     */
110    public void setRationale(final String argRationale) {
111        this.rationale = argRationale;
112    }
113    
114    public CommentInfo getComment() {
115        return comment;
116    }
117
118    public void setComment(CommentInfo comment) {
119        this.comment = comment;
120    }
121
122    @Override
123    public int compareTo(CMDecisionWrapper o) {
124        if (o.getComment() != null && getComment() != null &&
125            o.getComment().getMeta() != null &&
126            o.getComment().getMeta().getCreateTime() != null &&
127            getComment().getMeta() != null &&
128            getComment().getMeta().getCreateTime() != null ) {
129            return o.getComment().getMeta().getCreateTime().compareTo(getComment().getMeta().getCreateTime()) ;
130        } else {
131            return 0;
132        }
133    }
134}