1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.r2.common.dto;
17
18 import java.io.Serializable;
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.r2.common.infc.TimeOfDay;
28
29
30
31
32 @XmlAccessorType(XmlAccessType.FIELD)
33 @XmlType(name = "TimeOfDayInfo", propOrder = {"milliSeconds", "_futureElements" })
34 public class TimeOfDayInfo implements TimeOfDay, Serializable {
35
36 @XmlElement
37 private Long milliSeconds;
38
39 @XmlAnyElement
40 private List<Object> _futureElements;
41
42 public TimeOfDayInfo() {
43
44 }
45
46 public TimeOfDayInfo(TimeOfDay timeOfDay) {
47 if(null != timeOfDay) {
48 this.milliSeconds = timeOfDay.getMilliSeconds();
49 }
50 }
51
52 @Override
53 public Long getMilliSeconds() {
54 return this.milliSeconds;
55 }
56
57 public void setMilliSeconds(Long milliSeconds) {
58 this.milliSeconds = milliSeconds;
59 }
60
61
62
63
64
65
66 public boolean isAfter(TimeOfDay timeOfDay) {
67 return this.milliSeconds>timeOfDay.getMilliSeconds();
68 }
69
70
71
72
73
74
75 public boolean isBefore(TimeOfDay timeOfDay) {
76 return this.milliSeconds<timeOfDay.getMilliSeconds();
77 }
78
79
80
81
82
83
84
85
86 public boolean equals (Object obj) {
87 TimeOfDay timeOfDay = (TimeOfDay) obj;
88 return this.milliSeconds==timeOfDay.getMilliSeconds();
89 }
90
91 @Override
92 public int hashCode() {
93 return milliSeconds != null ? milliSeconds.hashCode() : 0;
94 }
95
96 @Override
97 public String toString() {
98 return "TimeOfDayInfo{" +
99 "milliSeconds=" + milliSeconds +
100 '}';
101 }
102 }