/**
 *
 */
package uk.co.autotrader.tingle.service.domain;

import javax.xml.bind.annotation.XmlRootElement;

/**
 * @author nguba
 */
@XmlRootElement(name = "user")
public final class User
{
	public Integer id;
	public String name;
	public String login;
	public String email;
	public Boolean light;
	public String icon_path;
	public Boolean activated;
	public Boolean admin;
	public String version_control_user_name;

	@Override
	public boolean equals(final Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		final User other = (User) obj;
		if (activated == null) {
			if (other.activated != null) {
				return false;
			}
		} else if (!activated.equals(other.activated)) {
			return false;
		}
		if (admin == null) {
			if (other.admin != null) {
				return false;
			}
		} else if (!admin.equals(other.admin)) {
			return false;
		}
		if (email == null) {
			if (other.email != null) {
				return false;
			}
		} else if (!email.equals(other.email)) {
			return false;
		}
		if (icon_path == null) {
			if (other.icon_path != null) {
				return false;
			}
		} else if (!icon_path.equals(other.icon_path)) {
			return false;
		}
		if (id == null) {
			if (other.id != null) {
				return false;
			}
		} else if (!id.equals(other.id)) {
			return false;
		}
		if (light == null) {
			if (other.light != null) {
				return false;
			}
		} else if (!light.equals(other.light)) {
			return false;
		}
		if (login == null) {
			if (other.login != null) {
				return false;
			}
		} else if (!login.equals(other.login)) {
			return false;
		}
		if (name == null) {
			if (other.name != null) {
				return false;
			}
		} else if (!name.equals(other.name)) {
			return false;
		}
		if (version_control_user_name == null) {
			if (other.version_control_user_name != null) {
				return false;
			}
		} else if (!version_control_user_name.equals(other.version_control_user_name)) {
			return false;
		}
		return true;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (prime * result) + ((activated == null) ? 0 : activated.hashCode());
		result = (prime * result) + ((admin == null) ? 0 : admin.hashCode());
		result = (prime * result) + ((email == null) ? 0 : email.hashCode());
		result = (prime * result) + ((icon_path == null) ? 0 : icon_path.hashCode());
		result = (prime * result) + ((id == null) ? 0 : id.hashCode());
		result = (prime * result) + ((light == null) ? 0 : light.hashCode());
		result = (prime * result) + ((login == null) ? 0 : login.hashCode());
		result = (prime * result) + ((name == null) ? 0 : name.hashCode());
		result = (prime * result) + ((version_control_user_name == null) ? 0 : version_control_user_name.hashCode());
		return result;
	}

	@Override
	public String toString() {
		return "User [id=" + id + ", name=" + name + ", login=" + login + ", email=" + email + ", light=" + light
				+ ", icon_path=" + icon_path + ", activated=" + activated + ", admin=" + admin
				+ ", version_control_user_name=" + version_control_user_name + "]";
	}
}
