package com.k_int.aggr2.mimsy.data;

import java.io.Serializable;

public class TitleDTO implements Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String title;
	private String type;
	private boolean prior;
	private AttributionDTO attribution;
	
	public TitleDTO(String title, String type, boolean prior, AttributionDTO attribution) 
	{
		this.title=title;
		this.type=type;
		this.attribution=attribution;	
		this.prior=prior;
	}
	
	public String getTitle()
	{
		return title;
	}
	
	public String getType()
	{
		return type;
	}
	
	public AttributionDTO getAttribution()
	{
		return attribution;
	}
	
	public boolean getPrior()
	{
		return prior;
	}
	
	public int hashCode()
	{
		return toString().hashCode();
	}
	
	 public boolean equals(Object o)
	  {
		  boolean retval=false;
		  if(o instanceof TitleDTO)
		  {
			  retval = (o.toString()).equals(this.toString());
		  }
			  
		  return retval;  
	  }
	
	
	public String toString()
	{
		StringBuilder builder = new StringBuilder();
		if(title!=null)
			builder.append(title);
		
		if(type!=null)
			builder.append(type);
		
		
		builder.append(Boolean.toString(prior));
		
		if(attribution!=null)
			builder.append(attribution);
		
		return builder.toString();
		
		
	}

}
