Subversion Repositories SmartDukaan

Rev

Rev 29329 | Rev 33134 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 29329 Rev 30077
Line 1... Line 1...
1
package com.spice.profitmandi.dao.model;
1
package com.spice.profitmandi.dao.model;
2
 
2
 
-
 
3
import java.time.LocalDate;
3
import java.time.LocalDateTime;
4
import java.time.LocalDateTime;
-
 
5
import java.time.LocalTime;
4
 
6
 
5
public class DateRangeModel {
7
public class DateRangeModel {
6
	LocalDateTime startDate;
8
	LocalDateTime startDate;
7
	LocalDateTime endDate;
9
	LocalDateTime endDate;
8
 
10
 
9
	public static DateRangeModel withEndDate(LocalDateTime endDate) {
11
	public static DateRangeModel withEndDate(LocalDateTime endDate) {
10
		DateRangeModel drm = new DateRangeModel();
12
		DateRangeModel drm = new DateRangeModel();
11
		drm.setEndDate(endDate);
13
		drm.setEndDate(endDate);
12
		return drm;
14
		return drm;
13
	}
15
	}
14
	
16
 
15
	public static DateRangeModel withStartDate(LocalDateTime startDate) {
17
	public static DateRangeModel withStartDate(LocalDateTime startDate) {
16
		DateRangeModel drm = new DateRangeModel();
18
		DateRangeModel drm = new DateRangeModel();
17
		drm.setStartDate(startDate);
19
		drm.setStartDate(startDate);
18
		return drm;
20
		return drm;
19
	}
21
	}
-
 
22
 
-
 
23
	public static DateRangeModel ofDate(LocalDate date) {
-
 
24
		DateRangeModel drm = new DateRangeModel();
-
 
25
		drm.setStartDate(date.atStartOfDay());
-
 
26
		drm.setEndDate(date.atTime(LocalTime.MAX));
-
 
27
		return drm;
-
 
28
	}
-
 
29
 
20
	public static DateRangeModel of(LocalDateTime startDate, LocalDateTime endDate) {
30
	public static DateRangeModel of(LocalDateTime startDate, LocalDateTime endDate) {
21
		DateRangeModel drm = new DateRangeModel();
31
		DateRangeModel drm = new DateRangeModel();
22
		drm.setEndDate(endDate);
32
		drm.setEndDate(endDate);
23
		drm.setStartDate(startDate);
33
		drm.setStartDate(startDate);
24
		return drm;
34
		return drm;
25
	}
35
	}
-
 
36
 
26
	public LocalDateTime getStartDate() {
37
	public LocalDateTime getStartDate() {
27
		return startDate;
38
		return startDate;
28
	}
39
	}
29
 
40
 
30
	public void setStartDate(LocalDateTime startDate) {
41
	public void setStartDate(LocalDateTime startDate) {
Line 72... Line 83...
72
				return false;
83
				return false;
73
		} else if (!startDate.equals(other.startDate))
84
		} else if (!startDate.equals(other.startDate))
74
			return false;
85
			return false;
75
		return true;
86
		return true;
76
	}
87
	}
77
	
-
 
78
	
-
 
79
 
88
 
80
}
89
}