/* * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package org.omg.CORBA; /** * The mapping of a CORBA enum tagging * SET_OVERRIDE and ADD_OVERRIDE, which * indicate whether policies should replace the * existing policies of an Object or be added to them. *

* The method {@link org.omg.CORBA.Object#_set_policy_override} takes * either SetOverrideType.SET_OVERRIDE or * SetOverrideType.ADD_OVERRIDE as its second argument. * The method _set_policy_override * creates a new Object initialized with the * Policy objects supplied as the first argument. If the * second argument is ADD_OVERRIDE, the new policies * are added to those of the Object instance that is * calling the _set_policy_override method. If * SET_OVERRIDE is given instead, the existing policies * are replaced with the given ones. * * @author OMG * @since JDK1.2 */ public class SetOverrideType implements org.omg.CORBA.portable.IDLEntity { /** * The int constant for the enum value SET_OVERRIDE. */ public static final int _SET_OVERRIDE = 0; /** * The int constant for the enum value ADD_OVERRIDE. */ public static final int _ADD_OVERRIDE = 1; /** * The SetOverrideType constant for the enum value SET_OVERRIDE. */ public static final SetOverrideType SET_OVERRIDE = new SetOverrideType(_SET_OVERRIDE); /** * The SetOverrideType constant for the enum value ADD_OVERRIDE. */ public static final SetOverrideType ADD_OVERRIDE = new SetOverrideType(_ADD_OVERRIDE); /** * Retrieves the value of this SetOverrideType instance. * * @return the int for this SetOverrideType instance. */ public int value() { return _value; } /** * Converts the given int to the corresponding * SetOverrideType instance. * * @param i the int to convert; must be either * SetOverrideType._SET_OVERRIDE or * SetOverrideType._ADD_OVERRIDE * @return the SetOverrideType instance whose value * matches the given int * @exception BAD_PARAM if the given int does not * match the value of * any SetOverrideType instance */ public static SetOverrideType from_int(int i) { switch (i) { case _SET_OVERRIDE: return SET_OVERRIDE; case _ADD_OVERRIDE: return ADD_OVERRIDE; default: throw new org.omg.CORBA.BAD_PARAM(); } } /** * Constructs a SetOverrideType instance from an * int. * @param _value must be either SET_OVERRIDE or * ADD_OVERRIDE */ protected SetOverrideType(int _value){ this._value = _value; } /** * The field containing the value for this SetOverrideType * object. * */ private int _value; }