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;
import com.dev.energy.server.model.security.Group;

public class UserGroupWarehouse extends Entity {

	private String description;

	private Group userGroup;

	private Warehouse warehouse;
	
	protected UserGroupWarehouse(){
		
	}
	
	public UserGroupWarehouse(Group userGroup,Warehouse warehouse,String description){
		this.userGroup = userGroup;
		this.warehouse = warehouse;
		this.description = description;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Warehouse getWarehouse() {
		return warehouse;
	}

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

	public boolean equals(final Object other) {
		if (!(other instanceof UserGroupWarehouse))
			return false;
		UserGroupWarehouse castOther = (UserGroupWarehouse) other;
		return new EqualsBuilder().append(userGroup, castOther.getUserGroup()).append(
				warehouse, castOther.getWarehouse()).isEquals();
	}
	public int hashCode() {
		return new HashCodeBuilder().append(userGroup).append(warehouse)
				.toHashCode();
	}

	public Group getUserGroup() {
		return userGroup;
	}

	public void setUserGroup(Group userGroup) {
		this.userGroup = userGroup;
	}
}
