package com.mjsheng.myappstore.bean;

import android.graphics.drawable.Drawable;

public class LocalAppInfo {

    public static final int DOWNLOAD_STATUS_NORMAL = 0;
    public static final int DOWNLOAD_STATUS_DOWNLOADING = 1;
    public static final int DOWNLOAD_STATUS_PAUSE = 2;
    private Drawable icon;
    private String iconUrl = "";
    private String appName;
    private String packageName;
    private String version;
    private String latestVersion = "";
    private int size;
    private String latestSize;
    private String downLoadUrl;
    private int dowloadStatus = DOWNLOAD_STATUS_NORMAL;
    private String tip;
    private int id;

    public Drawable getIcon() {
        return icon;
    }

    public void setIcon(Drawable icon) {
        this.icon = icon;
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public void setIconUrl(String iconUrl) {
        this.iconUrl = iconUrl;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public String getLatestVersion() {
        return latestVersion;
    }

    public void setLatestVersion(String latestVersion) {
        this.latestVersion = latestVersion;
    }

    public String getLatestSize() {
        return latestSize;
    }

    public void setLatestSize(String latestSize) {
        this.latestSize = latestSize;
    }

    public String getDownLoadUrl() {
        return downLoadUrl;
    }

    public void setDownLoadUrl(String downLoadUrl) {
        this.downLoadUrl = downLoadUrl;
    }

    public int getDowloadStatus() {
        return dowloadStatus;
    }

    public void setDowloadStatus(int dowloadStatus) {
        this.dowloadStatus = dowloadStatus;
    }

    public String getTip() {
        return tip;
    }

    public void setTip(String tip) {
        this.tip = tip;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "AppUpdateInfo{" +
                "packageName='" + packageName + '\'' +
                ", version='" + version + '\'' +
                '}';
    }


    public boolean equals(Object obj) {
        if (this == obj)      //传入的对象就是它自己，如s.equals(s)；肯定是相等的；
            return true;
        if (obj == null)     //如果传入的对象是空，肯定不相等
            return false;
        if (getClass() != obj.getClass())  //如果不是同一个类型的，如Studnet类和Animal类，
            //也不用比较了，肯定是不相等的
            return false;
        LocalAppInfo other = (LocalAppInfo) obj;
        if (packageName == null) {
            if (other.packageName != null)
                return false;
        } else if (!packageName.equals(other.packageName))   //如果name属性相等，则相等
            return false;
        return true;
    }
}
