| /******************************************************************************* |
| * Copyright (c) 2007 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.jst.javaee.ejb; |
| |
| import java.util.Arrays; |
| import java.util.Collections; |
| import java.util.List; |
| |
| import org.eclipse.emf.common.util.AbstractEnumerator; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * A representation of the literals of the enumeration '<em><b>Multiplicity Type</b></em>', |
| * and utility methods for working with them. |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * |
| * |
| * The multiplicityType describes the multiplicity of the |
| * role that participates in a relation. |
| * |
| * The value must be one of the two following: |
| * |
| * One |
| * Many |
| * |
| * |
| * <!-- end-model-doc --> |
| * @see org.eclipse.jst.javaee.ejb.internal.metadata.EjbPackage#getMultiplicityType() |
| * @generated |
| */ |
| public final class MultiplicityType extends AbstractEnumerator { |
| /** |
| * The '<em><b>One</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>One</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #ONE_LITERAL |
| * @generated |
| * @ordered |
| */ |
| public static final int ONE = 0; |
| |
| /** |
| * The '<em><b>Many</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Many</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #MANY_LITERAL |
| * @generated |
| * @ordered |
| */ |
| public static final int MANY = 1; |
| |
| /** |
| * The '<em><b>One</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #ONE |
| * @generated |
| * @ordered |
| */ |
| public static final MultiplicityType ONE_LITERAL = new MultiplicityType(ONE, "One", "One"); //$NON-NLS-1$ //$NON-NLS-2$ |
| |
| /** |
| * The '<em><b>Many</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #MANY |
| * @generated |
| * @ordered |
| */ |
| public static final MultiplicityType MANY_LITERAL = new MultiplicityType(MANY, "Many", "Many"); //$NON-NLS-1$ //$NON-NLS-2$ |
| |
| /** |
| * An array of all the '<em><b>Multiplicity Type</b></em>' enumerators. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private static final MultiplicityType[] VALUES_ARRAY = |
| new MultiplicityType[] { |
| ONE_LITERAL, |
| MANY_LITERAL, |
| }; |
| |
| /** |
| * A public read-only list of all the '<em><b>Multiplicity Type</b></em>' enumerators. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
| |
| /** |
| * Returns the '<em><b>Multiplicity Type</b></em>' literal with the specified literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static MultiplicityType get(String literal) { |
| for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| MultiplicityType result = VALUES_ARRAY[i]; |
| if (result.toString().equals(literal)) { |
| return result; |
| } |
| } |
| return null; |
| } |
| |
| /** |
| * Returns the '<em><b>Multiplicity Type</b></em>' literal with the specified name. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static MultiplicityType getByName(String name) { |
| for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| MultiplicityType result = VALUES_ARRAY[i]; |
| if (result.getName().equals(name)) { |
| return result; |
| } |
| } |
| return null; |
| } |
| |
| /** |
| * Returns the '<em><b>Multiplicity Type</b></em>' literal with the specified integer value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static MultiplicityType get(int value) { |
| switch (value) { |
| case ONE: return ONE_LITERAL; |
| case MANY: return MANY_LITERAL; |
| } |
| return null; |
| } |
| |
| /** |
| * Only this class can construct instances. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private MultiplicityType(int value, String name, String literal) { |
| super(value, name, literal); |
| } |
| |
| } //MultiplicityType |