001    package org.omg.PortableServer;
002    /**
003     * Generated from IDL enum "ServantRetentionPolicyValue".
004     *
005     * @author JacORB IDL compiler V 2.3.0 (JBoss patch 6), 06-Jun-2007
006     * @version generated at Sep 22, 2012 10:58:02 AM
007     */
008    
009    public final class ServantRetentionPolicyValue
010            implements org.omg.CORBA.portable.IDLEntity
011    {
012            private int value = -1;
013            public static final int _RETAIN = 0;
014            public static final ServantRetentionPolicyValue RETAIN = new ServantRetentionPolicyValue(_RETAIN);
015            public static final int _NON_RETAIN = 1;
016            public static final ServantRetentionPolicyValue NON_RETAIN = new ServantRetentionPolicyValue(_NON_RETAIN);
017            public int value()
018            {
019                    return value;
020            }
021            public static ServantRetentionPolicyValue from_int(int value)
022            {
023                    switch (value) {
024                            case _RETAIN: return RETAIN;
025                            case _NON_RETAIN: return NON_RETAIN;
026                            default: throw new org.omg.CORBA.BAD_PARAM();
027                    }
028            }
029            public String toString()
030            {
031                    switch (value) {
032                            case _RETAIN: return "RETAIN";
033                            case _NON_RETAIN: return "NON_RETAIN";
034                            default: throw new org.omg.CORBA.BAD_PARAM();
035                    }
036            }
037            protected ServantRetentionPolicyValue(int i)
038            {
039                    value = i;
040            }
041            java.lang.Object readResolve()
042            throws java.io.ObjectStreamException
043            {
044                    return from_int(value());
045            }
046    }