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 org.kuali.student.r2.common.infc.TimeOfDay;
19
20 import javax.xml.bind.annotation.XmlAccessType;
21 import javax.xml.bind.annotation.XmlAccessorType;
22 import javax.xml.bind.annotation.XmlElement;
23 import javax.xml.bind.annotation.XmlType;
24 import java.io.Serializable;
25
26
27
28
29 @XmlAccessorType(XmlAccessType.FIELD)
30 @XmlType(name = "TimeOfDayInfo", propOrder = {"milliSeconds"})
31 public class TimeOfDayInfo implements TimeOfDay, Serializable {
32
33 @XmlElement
34 private Long milliSeconds;
35
36
37
38
39
40 public TimeOfDayInfo() {
41
42 }
43
44 public TimeOfDayInfo(TimeOfDay timeOfDay) {
45 if(null != timeOfDay) {
46 this.milliSeconds = timeOfDay.getMilliSeconds();
47 }
48 }
49
50 @Override
51 public Long getMilliSeconds() {
52 return this.milliSeconds;
53 }
54
55 public void setMilliSeconds(Long milliSeconds) {
56 this.milliSeconds = milliSeconds;
57 }
58
59
60
61
62
63
64 public boolean isAfter(TimeOfDay timeOfDay) {
65 return this.milliSeconds>timeOfDay.getMilliSeconds();
66 }
67
68
69
70
71
72
73 public boolean isBefore(TimeOfDay timeOfDay) {
74 return this.milliSeconds<timeOfDay.getMilliSeconds();
75 }
76
77
78
79
80
81
82
83
84 public boolean equals (Object obj) {
85 TimeOfDay timeOfDay = (TimeOfDay) obj;
86 return this.milliSeconds==timeOfDay.getMilliSeconds();
87 }
88
89 @Override
90 public String toString() {
91 return "TimeOfDayInfo{" +
92 "milliSeconds=" + milliSeconds +
93 '}';
94 }
95 }