001/**
002 * Copyright 2012 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 */
016package org.kuali.student.enrollment.class2.courseoffering.dto;
017
018import java.util.Date;
019
020/**
021 * This is the model class which holds the SOC status and the dates.
022 * Note this class implemented with <code>Comparable</code> which allows the status collection
023 * to sort based on the ascending date for display purpose
024 *
025 * @author Kuali Student Team
026 */
027public class ManageSOCStatusHistory implements Comparable<ManageSOCStatusHistory>{
028
029    private String state;
030    private String stateKey;
031    private String date;
032    private Date dateObject;
033    private boolean highlightUI;
034    private boolean greyText;
035
036    public ManageSOCStatusHistory(){
037    }
038
039    public ManageSOCStatusHistory(String stateName,String stateKey,String date,Date dateObject){
040        this.state = stateName;
041        this.stateKey = stateKey;
042        this.date = date;
043        this.dateObject = dateObject;
044    }
045
046    public void setState(String state) {
047        this.state = state;
048    }
049
050    public void setDate(String date) {
051        this.date = date;
052    }
053
054    public String getState() {
055        return state;
056    }
057
058    public String getDate() {
059        return date;
060    }
061
062    public void setHighlightUI(boolean highlightUI) {
063        this.highlightUI = highlightUI;
064    }
065
066    public boolean isHighlightUI() {
067        return highlightUI;
068    }
069
070    public Date getDateObject() {
071        return dateObject;
072    }
073
074    public boolean isGreyText() {
075        return greyText;
076    }
077
078    public void setGreyText(boolean greyText) {
079        this.greyText = greyText;
080    }
081
082    public String getStateKey() {
083        return stateKey;
084    }
085
086    @Override
087    public int compareTo(ManageSOCStatusHistory manageSOCStatusHistory) {
088        //FindBugs - it is fine as is
089        if (this.getDateObject() != null && manageSOCStatusHistory.getDateObject() != null){
090            return getDateObject().compareTo(manageSOCStatusHistory.getDateObject());
091        }else if (manageSOCStatusHistory.getDateObject() == null){
092            return -1;
093        }else{
094            return 1;
095        }
096    }
097
098}