648540858
2022-02-24 a42dda2bd3cc1cf8c20cc61e7ad9211eadecbaf3
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package com.genersoft.iot.vmp.gb28181.bean;
 
 
import org.jetbrains.annotations.NotNull;
 
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
 
/**
 * @description:设备录像bean 
 * @author: swwheihei
 * @date:   2020年5月8日 下午2:06:54     
 */
public class RecordItem  implements Comparable<RecordItem>{
 
    private String deviceId;
    
    private String name;
    
    private String filePath;
    
    private String address;
    
    private String startTime;
    
    private String endTime;
    
    private int secrecy;
    
    private String type;
    
    private String recorderId;
 
    public String getDeviceId() {
        return deviceId;
    }
 
    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public String getFilePath() {
        return filePath;
    }
 
    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }
 
    public String getAddress() {
        return address;
    }
 
    public void setAddress(String address) {
        this.address = address;
    }
 
    public String getStartTime() {
        return startTime;
    }
 
    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }
 
    public String getEndTime() {
        return endTime;
    }
 
    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }
 
    public int getSecrecy() {
        return secrecy;
    }
 
    public void setSecrecy(int secrecy) {
        this.secrecy = secrecy;
    }
 
    public String getType() {
        return type;
    }
 
    public void setType(String type) {
        this.type = type;
    }
 
    public String getRecorderId() {
        return recorderId;
    }
 
    public void setRecorderId(String recorderId) {
        this.recorderId = recorderId;
    }
 
    @Override
    public int compareTo(@NotNull RecordItem recordItem) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            Date startTime_now = sdf.parse(startTime);
            Date startTime_param = sdf.parse(recordItem.getStartTime());
            if (startTime_param.compareTo(startTime_now) > 0) {
                return -1;
            }else {
                return 1;
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return 0;
    }
}