|  |  | 
 |  |  | package com.genersoft.iot.vmp.gb28181.bean;
 | 
 |  |  | 
 | 
 |  |  | /**     | 
 |  |  |  * @Description:设备录像bean  | 
 |  |  |  * @author: songww
 | 
 |  |  | 
 | 
 |  |  | import com.genersoft.iot.vmp.utils.DateUtil;
 | 
 |  |  | import org.jetbrains.annotations.NotNull;
 | 
 |  |  | 
 | 
 |  |  | import java.text.ParseException;
 | 
 |  |  | import java.time.Instant;
 | 
 |  |  | import java.time.temporal.TemporalAccessor;
 | 
 |  |  | 
 | 
 |  |  | /**
 | 
 |  |  |  * @description:设备录像bean  | 
 |  |  |  * @author: swwheihei
 | 
 |  |  |  * @date:   2020年5月8日 下午2:06:54     
 | 
 |  |  |  */
 | 
 |  |  | public class RecordItem {
 | 
 |  |  | public class RecordItem  implements Comparable<RecordItem>{
 | 
 |  |  | 
 | 
 |  |  |    private String deviceId;
 | 
 |  |  |    
 | 
 |  |  |    private String name;
 | 
 |  |  |    
 | 
 |  |  |    private String filePath;
 | 
 |  |  | 	 | 
 |  |  | 
 | 
 |  |  |    private String fileSize;
 | 
 |  |  | 
 | 
 |  |  |    private String address;
 | 
 |  |  |    
 | 
 |  |  |    private String startTime;
 | 
 |  |  | 
 |  |  |    
 | 
 |  |  |    private String type;
 | 
 |  |  |    
 | 
 |  |  |    private String recordId;
 | 
 |  |  |    private String recorderId;
 | 
 |  |  | 
 | 
 |  |  |    public String getDeviceId() {
 | 
 |  |  |       return deviceId;
 | 
 |  |  | 
 |  |  |       this.startTime = startTime;
 | 
 |  |  |    }
 | 
 |  |  | 
 | 
 |  |  |    public String getEndTime() {
 | 
 |  |  |       return endTime;
 | 
 |  |  |    }
 | 
 |  |  | 
 | 
 |  |  |    public void setEndTime(String endTime) {
 | 
 |  |  |       this.endTime = endTime;
 | 
 |  |  |    }
 | 
 |  |  | 
 | 
 |  |  |    public int getSecrecy() {
 | 
 |  |  |       return secrecy;
 | 
 |  |  |    }
 | 
 |  |  | 
 |  |  |       this.type = type;
 | 
 |  |  |    }
 | 
 |  |  | 
 | 
 |  |  |    public String getRecordId() {
 | 
 |  |  |       return recordId;
 | 
 |  |  |    public String getRecorderId() {
 | 
 |  |  |       return recorderId;
 | 
 |  |  |    }
 | 
 |  |  | 
 | 
 |  |  |    public void setRecordId(String recordId) {
 | 
 |  |  |       this.recordId = recordId;
 | 
 |  |  |    public void setRecorderId(String recorderId) {
 | 
 |  |  |       this.recorderId = recorderId;
 | 
 |  |  |    }
 | 
 |  |  | 
 | 
 |  |  |    public String getEndTime() {
 | 
 |  |  |       return endTime;
 | 
 |  |  |    public String getFileSize() {
 | 
 |  |  |       return fileSize;
 | 
 |  |  |    }
 | 
 |  |  | 
 | 
 |  |  |    public void setEndTime(String endTime) {
 | 
 |  |  |       this.endTime = endTime;
 | 
 |  |  |    public void setFileSize(String fileSize) {
 | 
 |  |  |       this.fileSize = fileSize;
 | 
 |  |  |    }
 | 
 |  |  | 
 | 
 |  |  |    @Override
 | 
 |  |  |    public int compareTo(@NotNull RecordItem recordItem) {
 | 
 |  |  |       TemporalAccessor startTimeNow = DateUtil.formatter.parse(startTime);
 | 
 |  |  |       TemporalAccessor startTimeParam = DateUtil.formatter.parse(recordItem.getStartTime());
 | 
 |  |  |       Instant startTimeParamInstant = Instant.from(startTimeParam);
 | 
 |  |  |       Instant startTimeNowInstant = Instant.from(startTimeNow);
 | 
 |  |  |       if (startTimeNowInstant.equals(startTimeParamInstant)) {
 | 
 |  |  |          return 0;
 | 
 |  |  |       }else if (Instant.from(startTimeParam).isAfter(Instant.from(startTimeNow)) ) {
 | 
 |  |  |          return -1;
 | 
 |  |  |       }else {
 | 
 |  |  |          return 1;
 | 
 |  |  |       }
 | 
 |  |  | 
 | 
 |  |  |    }
 | 
 |  |  | }
 |