/*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
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;
}