package com.njcn.pojo.commons.device;

import java.io.Serializable;

public class DeviceValue  implements Serializable,Comparable<DeviceValue>{
	
	private String name;
	
	private String amounts;
	
	private Status status = new Status();

	private String online;

	private String gwonline;

	private String dataIntegrity;

	private String gwdataIntegrity;

	private Status gdStatus = new Status();

	private String gwamounts;

	private int oncount;

	private int offcount;

	private String deptsIndex;

	public String getGwdataIntegrity() {
		return gwdataIntegrity;
	}

	public void setGwdataIntegrity(String gwdataIntegrity) {
		this.gwdataIntegrity = gwdataIntegrity;
	}


	public String getGwamounts() {
		return gwamounts;
	}

	public void setGwamounts(String gwamounts) {
		this.gwamounts = gwamounts;
	}

	public String getDataIntegrity() {
		return dataIntegrity;
	}

	public void setDataIntegrity(String dataIntegrity) {
		this.dataIntegrity = dataIntegrity;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the amounts
	 */
	public String getAmounts() {
		return amounts;
	}

	/**
	 * @param amounts the amounts to set
	 */
	public void setAmounts(String amounts) {
		this.amounts = amounts;
	}

	

	/**
	 * @return the status
	 */
	public Status getStatus() {
		return status;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(Status status) {
		this.status = status;
	}

	/**
	 * @return the online
	 */
	public String getOnline() {
		return online;
	}

	/**
	 * @param online the online to set
	 */
	public void setOnline(String online) {
		this.online = online;
	}

	public String getGwonline() {
		return gwonline;
	}

	public void setGwonline(String gwonline) {
		this.gwonline = gwonline;
	}

	public int getOncount() {
		return oncount;
	}

	public void setOncount(int oncount) {
		this.oncount = oncount;
	}

	public int getOffcount() {
		return offcount;
	}

	public void setOffcount(int offcount) {
		this.offcount = offcount;
	}

	public String getDeptsIndex() {
		return deptsIndex;
	}

	public void setDeptsIndex(String deptsIndex) {
		this.deptsIndex = deptsIndex;
	}

	public Status getGdStatus() {
		return gdStatus;
	}

	public void setGdStatus(Status gdStatus) {
		this.gdStatus = gdStatus;
	}

	@Override
	public String toString() {
		return "DeviceValue{" +
				"name='" + name + '\'' +
				", amounts='" + amounts + '\'' +
				", status=" + status +
				", online='" + online + '\'' +
				", gwonline='" + gwonline + '\'' +
				", dataIntegrity='" + dataIntegrity + '\'' +
				", gwdataIntegrity='" + gwdataIntegrity + '\'' +
				", gwamounts='" + gwamounts + '\'' +
				'}';
	}

	@Override
	public int compareTo(DeviceValue o) {
		if(Integer.valueOf(amounts)>Integer.valueOf(o.getAmounts())){
			return -1;
		}else if(Integer.valueOf(amounts)<Integer.valueOf(o.getAmounts())){
			return 1;
		}
		return 0;
	}
}
