/******************************************************************************* * Copyright (c) 2007 Oracle. 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: * Oracle - initial API and implementation ******************************************************************************/ package org.eclipse.jpt.core.internal.mappings; import static org.eclipse.jpt.core.internal.mappings.OrderingType.CUSTOM_VALUE; import static org.eclipse.jpt.core.internal.mappings.OrderingType.NONE_VALUE; import static org.eclipse.jpt.core.internal.mappings.OrderingType.PRIMARY_KEY_VALUE; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.eclipse.emf.common.util.Enumerator; /** * * A representation of the literals of the enumeration 'Ordering Type', * and utility methods for working with them. * * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getOrderingType() * @model * @generated */ public enum OrderingType implements Enumerator { /** * The 'NONE' literal object. * * * @see #NONE_VALUE * @generated * @ordered */ NONE(0, "NONE", "None"), /** * The 'PRIMARY KEY' literal object. * * * @see #PRIMARY_KEY_VALUE * @generated * @ordered */ PRIMARY_KEY(1, "PRIMARY_KEY", "Primary Key"), /** * The 'CUSTOM' literal object. * * * @see #CUSTOM_VALUE * @generated * @ordered */ CUSTOM(2, "CUSTOM", "Custom"); /** * The 'NONE' literal value. * *

* If the meaning of 'NONE' literal object isn't clear, * there really should be more of a description here... *

* * @see #NONE * @model literal="None" * @generated * @ordered */ public static final int NONE_VALUE = 0; /** * The 'PRIMARY KEY' literal value. * *

* If the meaning of 'PRIMARY KEY' literal object isn't clear, * there really should be more of a description here... *

* * @see #PRIMARY_KEY * @model literal="Primary Key" * @generated * @ordered */ public static final int PRIMARY_KEY_VALUE = 1; /** * The 'CUSTOM' literal value. * *

* If the meaning of 'CUSTOM' literal object isn't clear, * there really should be more of a description here... *

* * @see #CUSTOM * @model literal="Custom" * @generated * @ordered */ public static final int CUSTOM_VALUE = 2; /** * An array of all the 'Ordering Type' enumerators. * * * @generated */ private static final OrderingType[] VALUES_ARRAY = new OrderingType[] { NONE, PRIMARY_KEY, CUSTOM, }; /** * A public read-only list of all the 'Ordering Type' enumerators. * * * @generated */ public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the 'Ordering Type' literal with the specified literal value. * * * @generated */ public static OrderingType get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { OrderingType result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the 'Ordering Type' literal with the specified name. * * * @generated */ public static OrderingType getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { OrderingType result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the 'Ordering Type' literal with the specified integer value. * * * @generated */ public static OrderingType get(int value) { switch (value) { case NONE_VALUE : return NONE; case PRIMARY_KEY_VALUE : return PRIMARY_KEY; case CUSTOM_VALUE : return CUSTOM; } return null; } /** * * * @generated */ private final int value; /** * * * @generated */ private final String name; /** * * * @generated */ private final String literal; /** * Only this class can construct instances. * * * @generated */ private OrderingType(int value, String name, String literal) { this.value = value; this.name = name; this.literal = literal; } /** * * * @generated */ public int getValue() { return value; } /** * * * @generated */ public String getName() { return name; } /** * * * @generated */ public String getLiteral() { return literal; } /** * Returns the literal value of the enumerator, which is its string representation. * * * @generated */ @Override public String toString() { return literal; } } //OrderingType