1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns.dto;
17
18 import java.util.Date;
19
20 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
21
22 import org.kuali.rice.core.jaxb.SqlDateAdapter;
23
24 public class InactiveableInfo {
25 private static final long serialVersionUID = 1L;
26
27 protected Date activeFromDate;
28 protected Date activeToDate;
29 protected Date activeAsOfDate;
30
31
32
33
34
35 public boolean isActive() {
36 long asOfDate = System.currentTimeMillis();
37 if (activeAsOfDate != null) {
38 asOfDate = activeAsOfDate.getTime();
39 }
40
41 return (activeFromDate == null || asOfDate > activeFromDate.getTime())
42 && (activeToDate == null || asOfDate < activeToDate.getTime());
43 }
44
45 public void setActive(boolean active) {
46
47 }
48
49 public void setActiveFromDate(Date from) {
50 this.activeFromDate = from;
51 }
52
53 public void setActiveToDate(Date to) {
54 this.activeToDate = to;
55 }
56
57 public void setActiveAsOfDate(Date activeAsOfDate) {
58 this.activeAsOfDate = activeAsOfDate;
59 }
60
61 public Date getActiveFromDate() {
62 return this.activeFromDate;
63 }
64
65 public Date getActiveToDate() {
66 return this.activeToDate;
67 }
68
69 public Date getActiveAsOfDate() {
70 return this.activeAsOfDate;
71 }
72
73 }