package in.cdac.medinfo.csnotk.csnolib.disb.model;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

public class Manufacturer implements Serializable {
	private static final long serialVersionUID = 1L;

	private String id;


	private String country;

	private String manufacturerName;

	private String manufacturerSctId;
	
	private Set<MedicinalProduct> medicinalProducts = new HashSet<>();	
	
	private int version;
	
	private RecordStatus recordStatus;
	
	private Date dateOfCreation;
	
	private Date dateOfModification;
	
	public Manufacturer() {
		super();
	}

	public Manufacturer(String manufacturerId) {
		super();
		this.id = manufacturerId;
	}
	
	

	public Manufacturer(String manufacturerName, String manufacturerSctId) {
		super();
		this.manufacturerName = manufacturerName;
		this.manufacturerSctId = manufacturerSctId;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}


	public String getManufacturerSctId() {
		return manufacturerSctId;
	}

	public void setManufacturerSctId(String manufacturerSctId) {
		this.manufacturerSctId = manufacturerSctId;
	}

	


	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getManufacturerName() {
		return manufacturerName;
	}

	public void setManufacturerName(String manufacturerName) {
		this.manufacturerName = manufacturerName;
	}
	
	
	public Set<MedicinalProduct> getMedicinalProducts() {
		return medicinalProducts;
	}

	public void setMedicinalProducts(Set<MedicinalProduct> medicinalProducts) {
		this.medicinalProducts = medicinalProducts;
	}
	
	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	public RecordStatus getRecordStatus() {
		return recordStatus;
	}

	public void setRecordStatus(RecordStatus recordStatus) {
		this.recordStatus = recordStatus;
	}

	public Date getDateOfCreation() {
		return dateOfCreation;
	}

	public void setDateOfCreation(Date dateOfCreation) {
		this.dateOfCreation = dateOfCreation;
	}

	public Date getDateOfModification() {
		return dateOfModification;
	}

	public void setDateOfModification(Date dateOfModification) {
		this.dateOfModification = dateOfModification;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((country == null) ? 0 : country.hashCode());
		result = prime * result + ((manufacturerName == null) ? 0 : manufacturerName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Manufacturer other = (Manufacturer) obj;
		
		if (country == null) {
			if (other.country != null)
				return false;
		} else if (!country.equals(other.country))
			return false;
		if (manufacturerName == null) {
			if (other.manufacturerName != null)
				return false;
		} else if (!manufacturerName.equals(other.manufacturerName))
			return false;
		return true;
	}

}