package ervu.model.fileupload;

import java.util.Objects;

/**
 * @author Alexandr Shalaginov
 */
public class FileInfo {
  private String fileId;
  private String fileUrl;
  private String fileName;
  private String filePatternCode;
  private String filePatternName;
  private String fileSize;
  private String departureDateTime;
  private String timeZone;
  private FileStatus fileStatus;

  public FileInfo() {
  }

  public FileInfo(String fileId, String fileUrl, String fileName, String filePatternCode,
      String filePatternName, String fileSize, String departureDateTime, String timeZone,
      FileStatus fileStatus) {
    this.fileId = fileId;
    this.fileUrl = fileUrl;
    this.fileName = fileName;
    this.filePatternCode = filePatternCode;
    this.filePatternName = filePatternName;
    this.fileSize = fileSize;
    this.departureDateTime = departureDateTime;
    this.timeZone = timeZone;
    this.fileStatus = fileStatus;
  }

  public String getFileId() {
    return fileId;
  }

  public String getFileUrl() {
    return fileUrl;
  }

  public String getFileName() {
    return fileName;
  }

  public String getFilePatternCode() {
    return filePatternCode;
  }

  public String getFilePatternName() {
    return filePatternName;
  }

  public String getFileSize() {
    return fileSize;
  }

  public String getDepartureDateTime() {
    return departureDateTime;
  }

  public String getTimeZone() {
    return timeZone;
  }

  public FileStatus getFileStatus() {
    return fileStatus;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    FileInfo fileInfo = (FileInfo) o;
    return Objects.equals(fileId, fileInfo.fileId) && Objects.equals(fileUrl,
        fileInfo.fileUrl
    ) && Objects.equals(
        fileName, fileInfo.fileName) && Objects.equals(filePatternCode,
        fileInfo.filePatternCode
    ) && Objects.equals(filePatternName, fileInfo.filePatternName)
           && Objects.equals(departureDateTime, fileInfo.departureDateTime) &&
           Objects.equals(fileSize, fileInfo.getFileSize());
  }

  @Override
  public int hashCode() {
    return Objects.hash(fileId, fileUrl, fileName, filePatternCode, filePatternName,
        departureDateTime, fileSize
    );
  }

  @Override
  public String toString() {
    return "FileInfo{" +
           "fileId='" + fileId + '\'' +
           ", fileNameBase='" + fileUrl + '\'' +
           ", fileName='" + fileName + '\'' +
           ", filePatternCode='" + filePatternCode + '\'' +
           ", filePatternName='" + filePatternName + '\'' +
           ", departureDateTime='" + departureDateTime + '\'' +
           ", fileSize='" + fileSize + '\'' +
           '}';
  }
}
