package com.sheep.gamegroup.greendao.download;

import android.text.TextUtils;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.Unique;

import java.io.Serializable;

/**
 * download task info
 *
 * @author kemllor
 * @date 2017/6/13   0:13
 **/
@Entity
public class DownLoadInfo implements Serializable{

    /**
     * id
     */
    @Id(autoincrement = true)
    private Long mId;
    /**
     * creat time
     */
    @Property(nameInDb = "creat_time")
    private Long mCreateTime;

    /**
     * task id
     */
    @Property(nameInDb = "download_task_id")
    private Integer mDownloadTaskId;

    /**
     * game name
     */
    @Property(nameInDb = "game_name")
    private String mGameName;

    /**
     * icon url
     */
    @Property(nameInDb = "icon_url")
    private String mIconUrl;

    /**
     * progress per
     */
    @Property(nameInDb = "percent")
    private Integer mPercent;

    /**
     * game id
     @Unique
     */
    @NotNull
    @Property(nameInDb = "game_id")
    private Integer mGameID;

    /**
     * download size
     */
    @Property(nameInDb = "download_size")
    private Double mDownloadedSize;

    /**
     * total size
     */
    @Property(nameInDb = "total_size")
    private Double mTotalSize;

    /**
     * status 0 init  1 fail 2 donwloading  3 finish  4 paused  5  delete
     */
    @Property(nameInDb = "status")
    private Integer mStatus;

    /**
     * download url
     */
    @Unique
    @Property(nameInDb = "download_url")
    private String mDownloadUrl;


    /**
     * channel download url
     */
    @Unique
    @Property(nameInDb = "channel_download_url")
    private String mChannelDownloadUrl;

    /**
     * package_name
     */
    @Property(nameInDb = "package_name")
    private String mPackageName;

    /**
     * version code
     */
    @Property(nameInDb = "version_code")
    private Integer mVersionCode;

    /**
     * apk save path
     */
    @Property(nameInDb = "apk_path")
    private String mApkPath;

    /**
     * where from
     * 0:默认；1:任务模块来的
     */
    @Property(nameInDb = "where_from")
    private int whereFrom;
    /**
     * 下载速度
     */
    @Property(nameInDb = "average_speed")
    private String averageSpeed;
    /**
     * 下载速度
     */
    @Property(nameInDb = "real_cause_msg")
    private String realCauseMsg;

    public int getWhereFrom() {
        return whereFrom;
    }

    public void setWhereFrom(int whereFrom) {
        this.whereFrom = whereFrom;
    }

    public String getMApkPath() {
        return this.mApkPath;
    }

    public void setMApkPath(String mApkPath) {
        this.mApkPath = mApkPath;
    }

    public Integer getMVersionCode() {
        return this.mVersionCode;
    }

    public void setMVersionCode(Integer mVersionCode) {
        this.mVersionCode = mVersionCode;
    }

    public String getMPackageName() {
        return TextUtils.isEmpty(this.mPackageName)?"":this.mPackageName;
    }

    public void setMPackageName(String mPackageName) {
        this.mPackageName = mPackageName;
    }

    public String getMDownloadUrl() {
        return this.mDownloadUrl;
    }

    public void setMDownloadUrl(String mDownloadUrl) {
        this.mDownloadUrl = mDownloadUrl;
    }

    public Integer getMStatus() {
        return this.mStatus == null ? 0 : this.mStatus;
    }

    public void setMStatus(Integer mStatus) {
        this.mStatus = mStatus;
    }

    public Double getMTotalSize() {
        return this.mTotalSize;
    }

    public void setMTotalSize(Double mTotalSize) {
        this.mTotalSize = mTotalSize;
    }

    public Double getMDownloadedSize() {
        return this.mDownloadedSize;
    }

    public void setMDownloadedSize(Double mDownloadedSize) {
        this.mDownloadedSize = mDownloadedSize;
    }

    public Integer getMGameID() {
        return this.mGameID;
    }

    public void setMGameID(Integer mGameID) {
        this.mGameID = mGameID;
    }

    public Integer getMPercent() {
        return this.mPercent;
    }

    public void setMPercent(Integer mPercent) {
        this.mPercent = mPercent;
    }

    public String getMIconUrl() {
        return this.mIconUrl;
    }

    public void setMIconUrl(String mIconUrl) {
        this.mIconUrl = mIconUrl;
    }

    public String getMGameName() {
        return this.mGameName;
    }

    public void setMGameName(String mGameName) {
        this.mGameName = mGameName;
    }

    public Integer getMDownloadTaskId() {
        return this.mDownloadTaskId;
    }

    public void setMDownloadTaskId(Integer mDownloadTaskId) {
        this.mDownloadTaskId = mDownloadTaskId;
    }

    public Long getMCreateTime() {
        return this.mCreateTime;
    }

    public void setMCreateTime(Long mCreateTime) {
        this.mCreateTime = mCreateTime;
    }

    public Long getMId() {
        return this.mId;
    }

    public void setMId(Long mId) {
        this.mId = mId;
    }

    public String getMChannelDownloadUrl() {
        return this.mChannelDownloadUrl;
    }

    public void setMChannelDownloadUrl(String mChannelDownloadUrl) {
        this.mChannelDownloadUrl = mChannelDownloadUrl;
    }

    public String getAverageSpeed() {
        return this.averageSpeed;
    }

    public void setAverageSpeed(String averageSpeed) {
        this.averageSpeed = averageSpeed;
    }

    public String getRealCauseMsg() {
        return this.realCauseMsg;
    }

    public void setRealCauseMsg(String realCauseMsg) {
        this.realCauseMsg = realCauseMsg;
    }

    @Generated(hash = 74805486)
    public DownLoadInfo(Long mId, Long mCreateTime, Integer mDownloadTaskId,
            String mGameName, String mIconUrl, Integer mPercent, @NotNull Integer mGameID,
            Double mDownloadedSize, Double mTotalSize, Integer mStatus, String mDownloadUrl,
            String mChannelDownloadUrl, String mPackageName, Integer mVersionCode,
            String mApkPath, int whereFrom, String averageSpeed, String realCauseMsg) {
        this.mId = mId;
        this.mCreateTime = mCreateTime;
        this.mDownloadTaskId = mDownloadTaskId;
        this.mGameName = mGameName;
        this.mIconUrl = mIconUrl;
        this.mPercent = mPercent;
        this.mGameID = mGameID;
        this.mDownloadedSize = mDownloadedSize;
        this.mTotalSize = mTotalSize;
        this.mStatus = mStatus;
        this.mDownloadUrl = mDownloadUrl;
        this.mChannelDownloadUrl = mChannelDownloadUrl;
        this.mPackageName = mPackageName;
        this.mVersionCode = mVersionCode;
        this.mApkPath = mApkPath;
        this.whereFrom = whereFrom;
        this.averageSpeed = averageSpeed;
        this.realCauseMsg = realCauseMsg;
    }

    @Generated(hash = 1743687477)
    public DownLoadInfo() {
    }


}
