package database.dataview;

public class view_telephone extends view_client{
	private final int telephone_p_id;
	private final String telephone_numero;
	private final int telephone_type_p_id;
	private final String telephone_type_nom;
	/**
	 * @param client_p_id
	 * @param client_nom
	 * @param client_prenom
	 * @param client_commentaire
	 * @param adresse_p_id
	 * @param adresse_no_rue_app
	 * @param adresse_codepostal
	 * @param ville_p_id
	 * @param ville_nom
	 * @param province
	 * @param pays
	 * @param telephone_p_id
	 * @param telephone_numero
	 * @param telephone_type_p_id
	 * @param telephone_type_nom
	 */
	public view_telephone(int client_p_id, String client_nom,
			String client_prenom, String client_commentaire, int adresse_p_id,
			String adresse_no_rue_app, String adresse_codepostal,
			int ville_p_id, String ville_nom, String province, String pays,
			int telephone_p_id, String telephone_numero,
			int telephone_type_p_id, String telephone_type_nom) {
		super(client_p_id, client_nom, client_prenom, client_commentaire,
				adresse_p_id, adresse_no_rue_app, adresse_codepostal,
				ville_p_id, ville_nom, province, pays);
		this.telephone_p_id = telephone_p_id;
		this.telephone_numero = telephone_numero;
		this.telephone_type_p_id = telephone_type_p_id;
		this.telephone_type_nom = telephone_type_nom;
	}
	/**
	 * @return the telephone_p_id
	 */
	public int getTelephone_p_id() {
		return telephone_p_id;
	}
	/**
	 * @return the telephone_numero
	 */
	public String getTelephone_numero() {
		return telephone_numero;
	}
	/**
	 * @return the telephone_type_p_id
	 */
	public int getTelephone_type_p_id() {
		return telephone_type_p_id;
	}
	/**
	 * @return the telephone_type_nom
	 */
	public String getTelephone_type_nom() {
		return telephone_type_nom;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime
				* result
				+ ((telephone_numero == null) ? 0 : telephone_numero.hashCode());
		result = prime * result + telephone_p_id;
		result = prime
				* result
				+ ((telephone_type_nom == null) ? 0 : telephone_type_nom
						.hashCode());
		result = prime * result + telephone_type_p_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 (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		view_telephone other = (view_telephone) obj;
		if (telephone_numero == null) {
			if (other.telephone_numero != null)
				return false;
		} else if (!telephone_numero.equals(other.telephone_numero))
			return false;
		if (telephone_p_id != other.telephone_p_id)
			return false;
		if (telephone_type_nom == null) {
			if (other.telephone_type_nom != null)
				return false;
		} else if (!telephone_type_nom.equals(other.telephone_type_nom))
			return false;
		if (telephone_type_p_id != other.telephone_type_p_id)
			return false;
		return true;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "view_telephone [telephone_p_id=" + telephone_p_id
				+ ", telephone_numero=" + telephone_numero
				+ ", telephone_type_p_id=" + telephone_type_p_id
				+ ", telephone_type_nom=" + telephone_type_nom + "]";
	}

}
