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

import java.util.Date;
import java.util.Set;

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

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

public class ReceivedDoc extends Entity {

	private String code;
	
	private ASN asn;
	
	private Set<ReceivedRecord> receivedRecords;
	
	private Date createDate;
	
	protected ReceivedDoc(){
		
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Set<ReceivedRecord> getReceivedRecords() {
		return receivedRecords;
	}

	public void setReceivedRecords(Set<ReceivedRecord> receivedRecords) {
		this.receivedRecords = receivedRecords;
	}

	public ASN getAsn() {
		return asn;
	}

	public void setAsn(ASN asn) {
		this.asn = asn;
	}

	public boolean equals(final Object other) {
		if (!(other instanceof ReceivedDoc))
			return false;
		ReceivedDoc castOther = (ReceivedDoc) other;
		return new EqualsBuilder().append(code, castOther.getCode()).isEquals();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(code).toHashCode();
	}
	
}
