1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
package org.kuali.student.common.dto; |
14 | |
|
15 | |
import java.io.Serializable; |
16 | |
import java.util.Date; |
17 | |
|
18 | |
import javax.xml.bind.annotation.XmlAccessType; |
19 | |
import javax.xml.bind.annotation.XmlAccessorType; |
20 | |
import javax.xml.bind.annotation.XmlElement; |
21 | |
import javax.xml.bind.annotation.XmlTransient; |
22 | |
|
23 | |
import org.kuali.student.common.infc.Relationship; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
@XmlAccessorType(XmlAccessType.FIELD) |
30 | |
@XmlTransient |
31 | |
public abstract class RelationshipInfo extends IdEntityInfo implements Relationship, Serializable { |
32 | |
|
33 | |
@XmlElement |
34 | |
private final Date effectiveDate; |
35 | |
|
36 | |
@XmlElement |
37 | |
private final Date expirationDate; |
38 | |
|
39 | 0 | protected RelationshipInfo() { |
40 | 0 | effectiveDate = null; |
41 | 0 | expirationDate = null; |
42 | 0 | } |
43 | |
|
44 | |
protected RelationshipInfo(Relationship builder) { |
45 | 0 | super(builder); |
46 | 0 | this.effectiveDate = null != builder.getEffectiveDate() ? new Date(builder.getEffectiveDate().getTime()) : null; |
47 | 0 | this.expirationDate = null != builder.getExpirationDate() ? new Date(builder.getExpirationDate().getTime()) : null; |
48 | 0 | } |
49 | |
|
50 | |
@Override |
51 | |
public Date getEffectiveDate() { |
52 | 0 | return effectiveDate; |
53 | |
} |
54 | |
|
55 | |
@Override |
56 | |
public Date getExpirationDate() { |
57 | 0 | return expirationDate; |
58 | |
} |
59 | |
|
60 | |
public static class Builder extends IdEntityInfo.Builder implements Relationship { |
61 | |
|
62 | |
private Date effectiveDate; |
63 | |
private Date expirationDate; |
64 | |
|
65 | 0 | public Builder() {} |
66 | |
|
67 | |
public Builder(Relationship amrInfo) { |
68 | 0 | super(amrInfo); |
69 | 0 | this.effectiveDate = amrInfo.getEffectiveDate(); |
70 | 0 | this.expirationDate = amrInfo.getExpirationDate(); |
71 | 0 | } |
72 | |
|
73 | |
public Date getEffectiveDate() { |
74 | 0 | return effectiveDate; |
75 | |
} |
76 | |
|
77 | |
public void setEffectiveDate(Date effectiveDate) { |
78 | 0 | this.effectiveDate = effectiveDate; |
79 | 0 | } |
80 | |
|
81 | |
public Date getExpirationDate() { |
82 | 0 | return expirationDate; |
83 | |
} |
84 | |
|
85 | |
public void setExpirationDate(Date expirationDate) { |
86 | 0 | this.expirationDate = expirationDate; |
87 | 0 | } |
88 | |
} |
89 | |
} |