| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
package org.kuali.student.enrollment.classII.acal.dto; |
| 16 | |
|
| 17 | |
import java.io.Serializable; |
| 18 | |
import java.util.Date; |
| 19 | |
import java.util.List; |
| 20 | |
|
| 21 | |
import javax.xml.bind.annotation.XmlAccessType; |
| 22 | |
import javax.xml.bind.annotation.XmlAccessorType; |
| 23 | |
import javax.xml.bind.annotation.XmlAnyElement; |
| 24 | |
import javax.xml.bind.annotation.XmlElement; |
| 25 | |
import javax.xml.bind.annotation.XmlType; |
| 26 | |
|
| 27 | |
import org.kuali.student.enrollment.classII.acal.infc.Term; |
| 28 | |
import org.kuali.student.r2.common.dto.KeyEntityInfo; |
| 29 | |
import org.kuali.student.r2.common.infc.ModelBuilder; |
| 30 | |
import org.w3c.dom.Element; |
| 31 | |
|
| 32 | |
@XmlAccessorType(XmlAccessType.FIELD) |
| 33 | |
@XmlType(name = "TermInfo", propOrder = {"key", "typeKey", "stateKey", "name", "descr", "startDate", "endDate", "metaInfo", "attributes", "_futureElements"}) |
| 34 | |
|
| 35 | |
public class TermInfo extends KeyEntityInfo implements Term, Serializable { |
| 36 | |
private static final long serialVersionUID = 1L; |
| 37 | |
|
| 38 | |
@XmlElement |
| 39 | |
private final Date startDate; |
| 40 | |
|
| 41 | |
@XmlElement |
| 42 | |
private final Date endDate; |
| 43 | |
|
| 44 | |
@XmlAnyElement |
| 45 | |
private final List<Element> _futureElements; |
| 46 | |
|
| 47 | 0 | private TermInfo() { |
| 48 | 0 | startDate = null; |
| 49 | 0 | endDate = null; |
| 50 | 0 | _futureElements = null; |
| 51 | 0 | } |
| 52 | |
|
| 53 | |
|
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
|
| 58 | |
|
| 59 | |
public TermInfo(Term term) { |
| 60 | 0 | super(term); |
| 61 | |
|
| 62 | 0 | this.startDate = null != term.getStartDate() ? new Date(term.getStartDate().getTime()) : null; |
| 63 | 0 | this.endDate = null != term.getEndDate() ? new Date(term.getEndDate().getTime()) : null; |
| 64 | |
|
| 65 | 0 | _futureElements = null; |
| 66 | 0 | } |
| 67 | |
|
| 68 | |
|
| 69 | |
@Override |
| 70 | |
public Date getStartDate() { |
| 71 | 0 | return startDate; |
| 72 | |
} |
| 73 | |
|
| 74 | |
|
| 75 | |
@Override |
| 76 | |
public Date getEndDate() { |
| 77 | 0 | return endDate; |
| 78 | |
} |
| 79 | |
|
| 80 | |
|
| 81 | |
|
| 82 | |
|
| 83 | 0 | public static class Builder extends KeyEntityInfo.Builder implements ModelBuilder<TermInfo>, Term { |
| 84 | |
|
| 85 | |
private Date startDate; |
| 86 | |
private Date endDate; |
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | |
|
| 91 | 0 | public Builder() { |
| 92 | 0 | } |
| 93 | |
|
| 94 | |
|
| 95 | |
|
| 96 | |
|
| 97 | |
public Builder(Term term) { |
| 98 | 0 | super(term); |
| 99 | 0 | this.startDate = term.getStartDate(); |
| 100 | 0 | this.startDate = term.getEndDate(); |
| 101 | 0 | } |
| 102 | |
|
| 103 | |
@Override |
| 104 | |
public TermInfo build() { |
| 105 | 0 | return new TermInfo(this); |
| 106 | |
} |
| 107 | |
|
| 108 | |
@Override |
| 109 | |
public Date getStartDate() { |
| 110 | 0 | return startDate; |
| 111 | |
} |
| 112 | |
|
| 113 | |
public void setStartDate(Date startDate) { |
| 114 | 0 | this.startDate = startDate; |
| 115 | 0 | } |
| 116 | |
|
| 117 | |
@Override |
| 118 | |
public Date getEndDate() { |
| 119 | 0 | return endDate; |
| 120 | |
} |
| 121 | |
|
| 122 | |
public void setEndDate(Date endDate) { |
| 123 | 0 | this.endDate = endDate; |
| 124 | 0 | } |
| 125 | |
} |
| 126 | |
} |