package com.k_int.aggr2.mimsy.data;

import java.io.Serializable;

public class ControlledReferenceDTO implements Serializable
{
	private static final long serialVersionUID = 1L;
	private String text;
	private String identifier;
	private String relationship;
	private String position;
	
	public ControlledReferenceDTO(String identifier, String text,String relationship)
	{
		this.identifier=identifier;
		this.text=text;
		this.relationship=relationship;
	}
	
	public void setPosition(String position)
	{
		this.position=position;
	}
	
	public String getPosition()
	{
		return position;
	}
	
	
	
	public String getUrn()
	{
		return "urn://mol/"+getIdentifier();
	}
	
	public String getIdentifier()
	{
		return identifier;
	}
	
	public void setRelationship(String relationship)
	{
		this.relationship=relationship;
	}
	
	public String getText()
	{
		return text;
	}
	
	public void setText(String text)
	{
		this.text=text;
	}
	
	public String getRelationship()
	{
		return relationship;
	}
	
	public int hashCode()
	{
		return this.toString().hashCode();
	}
	
	 public boolean equals(Object o)
	  {
		  boolean retval=false;
		  if(o instanceof ControlledReferenceDTO)
		  {
			  retval = (o.toString()).equals(this.toString());
		  }
			  
		  return retval;  
	  }
	
	public String toString()
	{
		StringBuilder builder = new StringBuilder();
		if(identifier!=null)
			builder.append(identifier);
		
		if(text!=null)
			builder.append(text);
		
		if(relationship!=null)
			builder.append(relationship);
		
		return builder.toString();
		
	}

}
