package com.dev.swms.server.model.base;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

import com.dev.energy.server.model.Entity;

public class BoxModel extends Entity{
	private static final long serialVersionUID = 688838263260900457L;
	/** 仓库 */
	private Warehouse warehouse;
	/** 箱型代码 */
	private String caseCode;
	/** 箱类型 */
	private String type;
	/** 名称 */
	private String caseName;
	/** 重量 */
	private double weight;
	/** 体积 */
	private double volume;
	/** 是否失效 */
	private boolean disabled = false;
	/**是否回收*/
	private boolean beBack;
	/**总数量*/
	private long quantity;

	public boolean isBeBack() {
		return beBack;
	}

	public void setBeBack(boolean beBack) {
		this.beBack = beBack;
	}

	public long getQuantity() {
		return quantity;
	}

	public void setQuantity(long quantity) {
		this.quantity = quantity;
	}

	public Warehouse getWarehouse() {
		return warehouse;
	}

	public void setWarehouse(Warehouse warehouse) {
		this.warehouse = warehouse;
	}

	public String getCaseCode() {
		return caseCode;
	}

	public void setCaseCode(String caseCode) {
		this.caseCode = caseCode;
	}

	public String getCaseName() {
		return caseName;
	}

	public void setCaseName(String caseName) {
		this.caseName = caseName;
	}

	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	public double getVolume() {
		return volume;
	}

	public void setVolume(double volume) {
		this.volume = volume;
	}

	public double getWeight() {
		return weight;
	}

	public void setWeight(double weight) {
		this.weight = weight;
	}
	
	@Override
	public boolean equals(final Object other) {
		if (!(other instanceof BoxModel))
			return false;
		BoxModel castOther = (BoxModel) other;
		return new EqualsBuilder().append(warehouse, castOther.warehouse).append(caseCode, castOther.caseCode).isEquals();
	}

	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(warehouse).append(caseCode).toHashCode();
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
}