package com.inspect.ivs.view;

import com.inspect.ivs.util.TimeUtils;
import com.inspect.ivs.vo.IvsPlaybackRecListVo;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class IvsDevRecListView implements Serializable {
   @JsonProperty("DeviceID")
   private String DeviceID;
   @JsonProperty("Name")
   private String Name;
   @JsonProperty("SumNum")
   private int SumNum;
   @JsonProperty("RecordList")
   private List<IvsDevRecListView.Record> RecordList = new ArrayList<>();

   public IvsDevRecListView(IvsPlaybackRecListVo ivsPlaybackRecListVo, IvsRecListView ivsRecListView) {
      this.DeviceID = ivsPlaybackRecListVo.getSerial();
      this.SumNum = ivsRecListView.getRecordInfos().getTotal();
      ivsRecListView.getRecordInfos().getRecordInfoList().getRecordInfo().forEach((item) -> {
         IvsDevRecListView.Record record = new IvsDevRecListView.Record();
         this.RecordList.add(record);
         record.load(item, ivsPlaybackRecListVo);
      });
   }

   public String getDeviceID() {
      return this.DeviceID;
   }

   public String getName() {
      return this.Name;
   }

   public int getSumNum() {
      return this.SumNum;
   }

   public List<IvsDevRecListView.Record> getRecordList() {
      return this.RecordList;
   }

   @JsonProperty("DeviceID")
   public void setDeviceID(String DeviceID) {
      this.DeviceID = DeviceID;
   }

   @JsonProperty("Name")
   public void setName(String Name) {
      this.Name = Name;
   }

   @JsonProperty("SumNum")
   public void setSumNum(int SumNum) {
      this.SumNum = SumNum;
   }

   @JsonProperty("RecordList")
   public void setRecordList(List<IvsDevRecListView.Record> RecordList) {
      this.RecordList = RecordList;
   }

   public boolean equals(Object o) {
      if(o == this) {
         return true;
      } else if(!(o instanceof IvsDevRecListView)) {
         return false;
      } else {
         IvsDevRecListView other = (IvsDevRecListView)o;
         if(!other.canEqual(this)) {
            return false;
         } else if(this.getSumNum() != other.getSumNum()) {
            return false;
         } else {
            label49: {
               Object this$DeviceID = this.getDeviceID();
               Object other$DeviceID = other.getDeviceID();
               if(this$DeviceID == null) {
                  if(other$DeviceID == null) {
                     break label49;
                  }
               } else if(this$DeviceID.equals(other$DeviceID)) {
                  break label49;
               }

               return false;
            }

            Object this$Name = this.getName();
            Object other$Name = other.getName();
            if(this$Name == null) {
               if(other$Name != null) {
                  return false;
               }
            } else if(!this$Name.equals(other$Name)) {
               return false;
            }

            Object this$RecordList = this.getRecordList();
            Object other$RecordList = other.getRecordList();
            if(this$RecordList == null) {
               if(other$RecordList != null) {
                  return false;
               }
            } else if(!this$RecordList.equals(other$RecordList)) {
               return false;
            }

            return true;
         }
      }
   }

   protected boolean canEqual(Object other) {
      return other instanceof IvsDevRecListView;
   }

   public int hashCode() {
      int PRIME = 1;
      int result = 1;
       result = result * 59 + this.getSumNum();
      Object $DeviceID = this.getDeviceID();
      result = result * 59 + ($DeviceID == null?43:$DeviceID.hashCode());
      Object $Name = this.getName();
      result = result * 59 + ($Name == null?43:$Name.hashCode());
      Object $RecordList = this.getRecordList();
      result = result * 59 + ($RecordList == null?43:$RecordList.hashCode());
      return result;
   }

   public String toString() {
      return "IvsDevRecListView(DeviceID=" + this.getDeviceID() + ", Name=" + this.getName() + ", SumNum=" + this.getSumNum() + ", RecordList=" + this.getRecordList() + ")";
   }

   public IvsDevRecListView() {
   }

   static class Record {
      @JsonProperty("DeviceID")
      private String DeviceID;
      @JsonProperty("Name")
      private String Name;
      @JsonProperty("FilePath")
      private String FilePath;
      @JsonProperty("Address")
      private String Address;
      @JsonProperty("StartTime")
      private String StartTime;
      @JsonProperty("EndTime")
      private String EndTime;
      @JsonProperty("Secrecy")
      private String Secrecy;
      @JsonProperty("Type")
      private String Type;
      @JsonProperty("RecorderID")
      private String RecorderID;

      public void load(IvsRecListView.RecordInfo recordInfo, IvsPlaybackRecListVo ivsPlaybackRecListVo) {
         this.DeviceID = ivsPlaybackRecListVo.getSerial();
         this.FilePath = ivsPlaybackRecListVo.getCode() + "@" + recordInfo.getRecordFileName();
         this.StartTime = TimeUtils.toSip(recordInfo.getRecordTime().getStartTime());
         this.EndTime = TimeUtils.toSip(recordInfo.getRecordTime().getEndTime());
      }

      public String getDeviceID() {
         return this.DeviceID;
      }

      public String getName() {
         return this.Name;
      }

      public String getFilePath() {
         return this.FilePath;
      }

      public String getAddress() {
         return this.Address;
      }

      public String getStartTime() {
         return this.StartTime;
      }

      public String getEndTime() {
         return this.EndTime;
      }

      public String getSecrecy() {
         return this.Secrecy;
      }

      public String getType() {
         return this.Type;
      }

      public String getRecorderID() {
         return this.RecorderID;
      }

      @JsonProperty("DeviceID")
      public void setDeviceID(String DeviceID) {
         this.DeviceID = DeviceID;
      }

      @JsonProperty("Name")
      public void setName(String Name) {
         this.Name = Name;
      }

      @JsonProperty("FilePath")
      public void setFilePath(String FilePath) {
         this.FilePath = FilePath;
      }

      @JsonProperty("Address")
      public void setAddress(String Address) {
         this.Address = Address;
      }

      @JsonProperty("StartTime")
      public void setStartTime(String StartTime) {
         this.StartTime = StartTime;
      }

      @JsonProperty("EndTime")
      public void setEndTime(String EndTime) {
         this.EndTime = EndTime;
      }

      @JsonProperty("Secrecy")
      public void setSecrecy(String Secrecy) {
         this.Secrecy = Secrecy;
      }

      @JsonProperty("Type")
      public void setType(String Type) {
         this.Type = Type;
      }

      @JsonProperty("RecorderID")
      public void setRecorderID(String RecorderID) {
         this.RecorderID = RecorderID;
      }

      public boolean equals(Object o) {
         if(o == this) {
            return true;
         } else if(!(o instanceof IvsDevRecListView.Record)) {
            return false;
         } else {
            IvsDevRecListView.Record other = (IvsDevRecListView.Record)o;
            if(!other.canEqual(this)) {
               return false;
            } else {
               label119: {
                  Object this$DeviceID = this.getDeviceID();
                  Object other$DeviceID = other.getDeviceID();
                  if(this$DeviceID == null) {
                     if(other$DeviceID == null) {
                        break label119;
                     }
                  } else if(this$DeviceID.equals(other$DeviceID)) {
                     break label119;
                  }

                  return false;
               }

               Object this$Name = this.getName();
               Object other$Name = other.getName();
               if(this$Name == null) {
                  if(other$Name != null) {
                     return false;
                  }
               } else if(!this$Name.equals(other$Name)) {
                  return false;
               }

               label105: {
                  Object this$FilePath = this.getFilePath();
                  Object other$FilePath = other.getFilePath();
                  if(this$FilePath == null) {
                     if(other$FilePath == null) {
                        break label105;
                     }
                  } else if(this$FilePath.equals(other$FilePath)) {
                     break label105;
                  }

                  return false;
               }

               Object this$Address = this.getAddress();
               Object other$Address = other.getAddress();
               if(this$Address == null) {
                  if(other$Address != null) {
                     return false;
                  }
               } else if(!this$Address.equals(other$Address)) {
                  return false;
               }

               label91: {
                  Object this$StartTime = this.getStartTime();
                  Object other$StartTime = other.getStartTime();
                  if(this$StartTime == null) {
                     if(other$StartTime == null) {
                        break label91;
                     }
                  } else if(this$StartTime.equals(other$StartTime)) {
                     break label91;
                  }

                  return false;
               }

               Object this$EndTime = this.getEndTime();
               Object other$EndTime = other.getEndTime();
               if(this$EndTime == null) {
                  if(other$EndTime != null) {
                     return false;
                  }
               } else if(!this$EndTime.equals(other$EndTime)) {
                  return false;
               }

               label77: {
                  Object this$Secrecy = this.getSecrecy();
                  Object other$Secrecy = other.getSecrecy();
                  if(this$Secrecy == null) {
                     if(other$Secrecy == null) {
                        break label77;
                     }
                  } else if(this$Secrecy.equals(other$Secrecy)) {
                     break label77;
                  }

                  return false;
               }

               label70: {
                  Object this$Type = this.getType();
                  Object other$Type = other.getType();
                  if(this$Type == null) {
                     if(other$Type == null) {
                        break label70;
                     }
                  } else if(this$Type.equals(other$Type)) {
                     break label70;
                  }

                  return false;
               }

               Object this$RecorderID = this.getRecorderID();
               Object other$RecorderID = other.getRecorderID();
               if(this$RecorderID == null) {
                  if(other$RecorderID != null) {
                     return false;
                  }
               } else if(!this$RecorderID.equals(other$RecorderID)) {
                  return false;
               }

               return true;
            }
         }
      }

      protected boolean canEqual(Object other) {
         return other instanceof IvsDevRecListView.Record;
      }

      public int hashCode() {
         int PRIME = 1;
         int resultx = 1;
         Object $DeviceID = this.getDeviceID();
         int result = resultx * 59 + ($DeviceID == null?43:$DeviceID.hashCode());
         Object $Name = this.getName();
         result = result * 59 + ($Name == null?43:$Name.hashCode());
         Object $FilePath = this.getFilePath();
         result = result * 59 + ($FilePath == null?43:$FilePath.hashCode());
         Object $Address = this.getAddress();
         result = result * 59 + ($Address == null?43:$Address.hashCode());
         Object $StartTime = this.getStartTime();
         result = result * 59 + ($StartTime == null?43:$StartTime.hashCode());
         Object $EndTime = this.getEndTime();
         result = result * 59 + ($EndTime == null?43:$EndTime.hashCode());
         Object $Secrecy = this.getSecrecy();
         result = result * 59 + ($Secrecy == null?43:$Secrecy.hashCode());
         Object $Type = this.getType();
         result = result * 59 + ($Type == null?43:$Type.hashCode());
         Object $RecorderID = this.getRecorderID();
         result = result * 59 + ($RecorderID == null?43:$RecorderID.hashCode());
         return result;
      }

      public String toString() {
         return "IvsDevRecListView.Record(DeviceID=" + this.getDeviceID() + ", Name=" + this.getName() + ", FilePath=" + this.getFilePath() + ", Address=" + this.getAddress() + ", StartTime=" + this.getStartTime() + ", EndTime=" + this.getEndTime() + ", Secrecy=" + this.getSecrecy() + ", Type=" + this.getType() + ", RecorderID=" + this.getRecorderID() + ")";
      }
   }
}
