-
Notifications
You must be signed in to change notification settings - Fork 0
/
Call.java
39 lines (29 loc) · 871 Bytes
/
Call.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package goodComposition;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;
public class Call {
private final DateTimeInterval interval;
public Call(final LocalDateTime from, final LocalDateTime to) {
this.interval = DateTimeInterval.of(from, to);
}
public Duration getDuration() {
return interval.duration();
}
public boolean isFromOverAndEqualTo(final LocalTime localTime) {
return getFrom().getHour() >= localTime.getHour();
}
public List<DateTimeInterval> splitByDay() {
return interval.splitByDay();
}
public DateTimeInterval getInterval() {
return interval;
}
public LocalDateTime getFrom(){
return interval.getFrom();
}
public LocalDateTime getTo(){
return interval.getTo();
}
}