package test.interop.bug360;
/**
 * Generated from IDL enum "Enum1".
 *
 * @author JacORB IDL compiler V @project.version@
 * @version generated at 25-Feb-2014 13:44:20
 */

public abstract class Enum1Helper
{
	private volatile static org.omg.CORBA.TypeCode _type;
	public static org.omg.CORBA.TypeCode type ()
	{
		if (_type == null)
		{
			synchronized(Enum1Helper.class)
			{
				if (_type == null)
				{
					_type = org.omg.CORBA.ORB.init().create_enum_tc(test.interop.bug360.Enum1Helper.id(),"Enum1",new String[]{"E1Axxxxxxxxxxxxxxxxxxxxx","E1B","E1C","E1D","E1E","E1F","E1G","E1H","E1I","E1JX","E1KX","E1LX","E1MX","E1Lastxxxxxxxxxxxxx"});
				}
			}
		}
		return _type;
	}

	public static void insert (final org.omg.CORBA.Any any, final test.interop.bug360.Enum1 s)
	{
		any.type(type());
		write( any.create_output_stream(),s);
	}

	public static test.interop.bug360.Enum1 extract (final org.omg.CORBA.Any any)
	{
		org.omg.CORBA.portable.InputStream in = any.create_input_stream();
		try
		{
			return read (in);
		}
		finally
		{
			try
			{
				in.close();
			}
			catch (java.io.IOException e)
			{
			throw new RuntimeException("Unexpected exception " + e.toString() );
			}
		}
	}

	public static String id()
	{
		return "IDL:test/interop/bug360/Enum1:1.0";
	}
	public static Enum1 read (final org.omg.CORBA.portable.InputStream in)
	{
		return Enum1.from_int(in.read_long());
	}

	public static void write (final org.omg.CORBA.portable.OutputStream out, final Enum1 s)
	{
		out.write_long(s.value());
	}
}
