| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
package org.kuali.student.r2.common.dto; |
| 10 | |
|
| 11 | |
import java.io.Serializable; |
| 12 | |
import java.util.Date; |
| 13 | |
import java.util.List; |
| 14 | |
|
| 15 | |
import javax.xml.bind.annotation.XmlAccessType; |
| 16 | |
import javax.xml.bind.annotation.XmlAccessorType; |
| 17 | |
import javax.xml.bind.annotation.XmlAnyElement; |
| 18 | |
import javax.xml.bind.annotation.XmlAttribute; |
| 19 | |
import javax.xml.bind.annotation.XmlElement; |
| 20 | |
import javax.xml.bind.annotation.XmlType; |
| 21 | |
|
| 22 | |
import org.kuali.student.r2.common.infc.State; |
| 23 | |
import org.w3c.dom.Element; |
| 24 | |
|
| 25 | |
@SuppressWarnings("serial") |
| 26 | |
@XmlAccessorType(XmlAccessType.FIELD) |
| 27 | |
@XmlType(name = "StateInfo", propOrder = {"key", "name", "descr", "effectiveDate", "expirationDate", "attributes", "_futureElements"}) |
| 28 | |
public class StateInfo extends HasAttributesInfo implements State, Serializable { |
| 29 | |
|
| 30 | |
@XmlAttribute |
| 31 | |
private String key; |
| 32 | |
|
| 33 | |
@XmlElement |
| 34 | |
private String name; |
| 35 | |
|
| 36 | |
@XmlElement |
| 37 | |
private String descr; |
| 38 | |
|
| 39 | |
@XmlElement |
| 40 | |
private Date effectiveDate; |
| 41 | |
|
| 42 | |
@XmlElement |
| 43 | |
private Date expirationDate; |
| 44 | |
|
| 45 | |
@XmlAnyElement |
| 46 | |
private List<Element> _futureElements; |
| 47 | |
|
| 48 | |
public static StateInfo getInstance(State state) { |
| 49 | 0 | return new StateInfo(state); |
| 50 | |
} |
| 51 | |
|
| 52 | |
public static StateInfo newInstance(){ |
| 53 | 0 | return new StateInfo(); |
| 54 | |
} |
| 55 | |
|
| 56 | 0 | public StateInfo() { |
| 57 | 0 | key = null; |
| 58 | 0 | name = null; |
| 59 | 0 | descr = null; |
| 60 | 0 | effectiveDate = null; |
| 61 | 0 | expirationDate = null; |
| 62 | 0 | _futureElements = null; |
| 63 | 0 | } |
| 64 | |
|
| 65 | |
public StateInfo(State sInfo) { |
| 66 | 0 | super(sInfo); |
| 67 | 0 | if(sInfo != null){ |
| 68 | 0 | this.key = sInfo.getKey(); |
| 69 | 0 | this.name = sInfo.getName(); |
| 70 | 0 | this.descr = sInfo.getDescr(); |
| 71 | 0 | this.effectiveDate = null != sInfo.getEffectiveDate() ? new Date(sInfo.getEffectiveDate().getTime()) : null; |
| 72 | 0 | this.expirationDate = null != sInfo.getExpirationDate() ? new Date(sInfo.getExpirationDate().getTime()) : null; |
| 73 | 0 | this._futureElements = null; |
| 74 | |
} |
| 75 | 0 | } |
| 76 | |
|
| 77 | |
@Override |
| 78 | |
public String getKey() { |
| 79 | 0 | return key; |
| 80 | |
} |
| 81 | |
|
| 82 | |
public void setKey(String key) { |
| 83 | 0 | this.key = key; |
| 84 | 0 | } |
| 85 | |
|
| 86 | |
@Override |
| 87 | |
public String getName() { |
| 88 | 0 | return name; |
| 89 | |
} |
| 90 | |
|
| 91 | |
public void setName(String name) { |
| 92 | 0 | this.name = name; |
| 93 | 0 | } |
| 94 | |
|
| 95 | |
@Override |
| 96 | |
public String getDescr() { |
| 97 | 0 | return descr; |
| 98 | |
} |
| 99 | |
|
| 100 | |
public void setDescr(String descr) { |
| 101 | 0 | this.descr = descr; |
| 102 | 0 | } |
| 103 | |
|
| 104 | |
@Override |
| 105 | |
public Date getEffectiveDate() { |
| 106 | 0 | return effectiveDate != null ? new Date(effectiveDate.getTime()) : null; |
| 107 | |
} |
| 108 | |
|
| 109 | |
|
| 110 | |
public void setEffectiveDate(Date effectiveDate) { |
| 111 | 0 | if(effectiveDate != null) |
| 112 | 0 | this.effectiveDate = new Date(effectiveDate.getTime()); |
| 113 | 0 | } |
| 114 | |
|
| 115 | |
@Override |
| 116 | |
public Date getExpirationDate() { |
| 117 | 0 | return expirationDate != null ? new Date(expirationDate.getTime()) : null; |
| 118 | |
} |
| 119 | |
|
| 120 | |
|
| 121 | |
public void setExpirationDate(Date expirationDate) { |
| 122 | 0 | if(expirationDate != null) |
| 123 | 0 | this.expirationDate = new Date(expirationDate.getTime()); |
| 124 | 0 | } |
| 125 | |
} |