package lu.tudor.santec.gecamed.esante.utils;

import java.io.Serializable;

/**
 * @author jens.ferring(at)tudor.lu
 * 
 * @version
 * <br>$Log: InfoString.java,v $
 * <br>Revision 1.2  2013-06-24 12:56:53  ferring
 * <br>comparable to object now, instead of to String
 * <br>
 * <br>Revision 1.1  2013-06-10 08:22:14  ferring
 * <br>eSante POC
 * <br>
 */

public class InfoString implements Comparable<Object>, Serializable
{
	/* ======================================== */
	// MEMBERS
	/* ======================================== */
	
	private static final long	serialVersionUID	= 1L;
	
	private String s;
	
	private boolean isESante;
	
	
	
	/* ======================================== */
	// CONSTRUCTORS
	/* ======================================== */
	
	public InfoString (String theString, boolean isESantePatient)
	{
		this.s = theString;
		this.isESante = isESantePatient;
	}
	
	
	
	/* ======================================== */
	// CLASS BODY
	/* ======================================== */
	
	public String toString() 
	{
		return s;
	}
	
	
	public void setString (String s)
	{
		this.s = s;
	}
	
	
	public boolean isESantePatient ()
	{
		return isESante;
	}



	public int compareTo (Object o)
	{
		String s = String.valueOf(o);
		
		if (this.s == null)
			return -1;
		else
			return this.s.compareTo(s);
	}
}
