package com.tandbergtv.watchpoint.pmm.entities;

public class TitleProperty {
	private Long id;
	private String name, value;
	private Long titleId, assetListId, contextId;
	
	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the value
	 */
	public String getValue() {
		return value;
	}
	/**
	 * @param value the value to set
	 */
	public void setValue(String value) {
		this.value = value;
	}
	/**
	 * @return the titleId
	 */
	public Long getTitleId() {
		return titleId;
	}
	/**
	 * @param titleId the titleId to set
	 */
	public void setTitleId(Long titleId) {
		this.titleId = titleId;
	}
	/**
	 * @return the assetListId
	 */
	public Long getAssetListId() {
		return assetListId;
	}
	/**
	 * @param assetListId the assetListId to set
	 */
	public void setAssetListId(Long assetListId) {
		this.assetListId = assetListId;
	}
	/**
	 * @return the contextId
	 */
	public Long getContextId() {
		return contextId;
	}
	/**
	 * @param contextId the contextId to set
	 */
	public void setContextId(Long contextId) {
		this.contextId = contextId;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		if(id == null)
			return super.hashCode();
		else
			return 3 * id.hashCode() + 7;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof TitleProperty))
			return false;

		if (id == null) {
			return super.equals(obj);
		} 

		TitleProperty tpObj = (TitleProperty) obj;
		return id.equals(tpObj.id);
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "[" + id + "]";
	}
}
