package com.cesgroup.cesmonitor.bean;

import java.io.Serializable;

/**
 *
 *
 * @author user
 * @version 1.0.0 2017年5月10日
 */
public class Disk implements Serializable, Comparable<Disk> {

    /**
     *
     */
    private static final long serialVersionUID = 8896100516107487345L;

    private String hostName;

    private String hostId;

    private double diskRate;

    private String itemName;

    private String itemKey;

    /**
     * 构造函数
     */
    public Disk(final String hostName, final double diskRate, final String itemName, final String itemKey) {
        super();
        this.hostName = hostName;
        this.diskRate = diskRate;
        this.itemName = itemName;
        this.itemKey = itemKey;
    }

    public Disk() {
        super();
    }

    public String getHostName() {
        return hostName;
    }

    public void setHostName(final String hostName) {
        this.hostName = hostName;
    }

    public double getDiskRate() {
        return diskRate;
    }

    public void setDiskRate(final double diskRate) {
        this.diskRate = diskRate;
    }

    public String getItemName() {
        return itemName;
    }

    public void setItemName(final String itemName) {
        this.itemName = itemName;
    }

    public String getItemKey() {
        return itemKey;
    }

    public void setItemKey(final String itemKey) {
        this.itemKey = itemKey;
    }

    @Override
    public int compareTo(final Disk disk) {
        if (this == disk) {
            return 0;
        } else if (disk != null && disk instanceof Disk) {
            Disk d = disk;
            if (this.diskRate < d.diskRate) {
                return -1;
            } else if (this.diskRate > d.diskRate) {
                return 1;
            } else {
                return 0;
            }
        } else {
            return -1;
        }
    }

    /**
     * @return the hostId
     */
    public String getHostId() {
        return hostId;
    }

    /**
     * @param hostId
     *            the hostId to set
     */
    public void setHostId(final String hostId) {
        this.hostId = hostId;
    }
}
