/*
 * (c) 2020 Pluto Inc.
 */
package tv.pluto.mongo.entities.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Origin {
  private String url = "";
  private String srcUrl = "";
  private String type = "";
  private Integer inPoint;
  private Integer outPoint;
  private Integer bitrate;
  private Integer duration;
  private Integer height;
  private Integer width;
  private String md5 = "";
  private Boolean generatingFile;

  public Boolean getGeneratingFile() {
    return generatingFile != null && generatingFile;
  }

  public Integer getBitrate() {
    return bitrate == null ? 0 : bitrate;
  }

  public Integer getDuration() {
    return duration == null ? 0 : duration;
  }

  public Integer getHeight() {
    return height == null ? 0 : height;
  }

  public Integer getWidth() {
    return width == null ? 0 : width;
  }

  public Integer getInPoint() {
    return inPoint == null ? 0 : inPoint;
  }

  public Integer getOutPoint() {
    return outPoint == null ? 0 : outPoint;
  }

  public String getUrl() {
    return url == null ? "" : url;
  }

  public String getMd5() {
    return md5 == null ? "" : md5;
  }

  public String getSrcUrl() {
    return srcUrl == null ? "" : srcUrl;
  }

  public String getType() {
    return type == null ? "" : type;
  }
}
