package tool.regEx;

import java.io.Serializable;

/**
 * @author alexis
 * dataset de la table Adresse
 */
public class Adresse implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -1078098251409734883L;
	private int adresse_p_id;
	private String adresse_no_rue_app;
	private int ville_fk_id;
	private String adresse_codepostal;
	public final String NOM_TABLE = "adresse";

	/**************************************************************************
	 * constructeur
	 *************************************************************************/
	
	public Adresse(int adresse_p_id, String adresse_no_rue_app, int ville_fk_id,
				   String adresse_codepostal) {
		this.adresse_p_id = adresse_p_id;
		this.adresse_no_rue_app = adresse_no_rue_app;
		this.ville_fk_id = ville_fk_id;
		this.adresse_codepostal = adresse_codepostal;
	}

	/**************************************************************************
	 * getter
	 *************************************************************************/
	
	/**
	 * @return the adresse_p_id
	 */
	public int getadresse_p_id() {
		return adresse_p_id;
	}

	/**
	 * @return the adresse_no_rue_app
	 */
	public String getadresse_no_rue_app() {
		return adresse_no_rue_app;
	}

	/**
	 * @return the ville_fk_id
	 */
	public int getVille_fk_id() {
		return ville_fk_id;
	}

	/**
	 * @return the adresse_codepostal
	 */
	public String getAdresse_codepostal() {
		return adresse_codepostal;
	}

	/**
	 * Retourne le nom de la table
	 * @return NOM_TABLE
	 */
	public String getNomTable()
	{
		return NOM_TABLE;		
	}
	
	/**************************************************************************
	 * setter
	 *************************************************************************/
	
	/**
	 * @param adresse_p_id the adresse_p_id to set
	 */
	public void setadresse_p_id(int adresse_p_id) {
		this.adresse_p_id = adresse_p_id;
	}

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

	/**
	 * @param ville_fk_id the ville_fk_id to set
	 */
	public void setVille_fk_id(int ville_fk_id) {
		this.ville_fk_id = ville_fk_id;
	}

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

	/**************************************************************************
	 * object
	 *************************************************************************/

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Adresse [adresse_p_id=" + adresse_p_id
				+ ", adresse_no_rue_app=" + adresse_no_rue_app
				+ ", ville_fk_id=" + ville_fk_id + ", adresse_codepostal="
				+ adresse_codepostal + "]";
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime
				* result
				+ ((adresse_codepostal == null) ? 0 : adresse_codepostal
						.hashCode());
		result = prime
				* result
				+ ((adresse_no_rue_app == null) ? 0 : adresse_no_rue_app
						.hashCode());
		result = prime * result + adresse_p_id;
		result = prime * result + ville_fk_id;
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof Adresse))
			return false;
		Adresse other = (Adresse) obj;
		if (adresse_codepostal == null) {
			if (other.adresse_codepostal != null)
				return false;
		} else if (!adresse_codepostal.equals(other.adresse_codepostal))
			return false;
		if (adresse_no_rue_app == null) {
			if (other.adresse_no_rue_app != null)
				return false;
		} else if (!adresse_no_rue_app.equals(other.adresse_no_rue_app))
			return false;
		if (adresse_p_id != other.adresse_p_id)
			return false;
		if (ville_fk_id != other.ville_fk_id)
			return false;
		return true;
	}
}