001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: IdentifierGenerationOptionType.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.wfs;
007:
008: import java.util.Arrays;
009: import java.util.Collections;
010: import java.util.List;
011:
012: import org.eclipse.emf.common.util.AbstractEnumerator;
013:
014: /**
015: * <!-- begin-user-doc -->
016: * A representation of the literals of the enumeration '<em><b>Identifier Generation Option Type</b></em>',
017: * and utility methods for working with them.
018: * <!-- end-user-doc -->
019: * @see net.opengis.wfs.WfsPackage#getIdentifierGenerationOptionType()
020: * @model
021: * @generated
022: */
023: public final class IdentifierGenerationOptionType extends
024: AbstractEnumerator {
025: /**
026: * The '<em><b>Use Existing</b></em>' literal value.
027: * <!-- begin-user-doc -->
028: * <!-- end-user-doc -->
029: * <!-- begin-model-doc -->
030: *
031: * The UseExsiting value indicates that WFS should not
032: * generate a new feature identifier for the feature
033: * being inserted into the repositry. Instead, the WFS
034: * should use the identifier encoded if the feature.
035: * If a duplicate exists then the WFS should raise an
036: * exception.
037: * <!-- end-model-doc -->
038: * @see #USE_EXISTING_LITERAL
039: * @model name="UseExisting"
040: * @generated
041: * @ordered
042: */
043: public static final int USE_EXISTING = 0;
044:
045: /**
046: * The '<em><b>Replace Duplicate</b></em>' literal value.
047: * <!-- begin-user-doc -->
048: * <!-- end-user-doc -->
049: * <!-- begin-model-doc -->
050: *
051: * The ReplaceDuplicate value indicates that WFS should
052: * not generate a new feature identifier for the feature
053: * being inserted into the repositry. Instead, the WFS
054: * should use the identifier encoded if the feature.
055: * If a duplicate exists then the WFS should replace the
056: * existing feature instance with the one encoded in the
057: * Insert action.
058: * <!-- end-model-doc -->
059: * @see #REPLACE_DUPLICATE_LITERAL
060: * @model name="ReplaceDuplicate"
061: * @generated
062: * @ordered
063: */
064: public static final int REPLACE_DUPLICATE = 1;
065:
066: /**
067: * The '<em><b>Generate New</b></em>' literal value.
068: * <!-- begin-user-doc -->
069: * <!-- end-user-doc -->
070: * <!-- begin-model-doc -->
071: *
072: * The GenerateNew value indicates that WFS should
073: * generate a new unique feature identifier for the
074: * feature being inserted into the repositry.
075: * <!-- end-model-doc -->
076: * @see #GENERATE_NEW_LITERAL
077: * @model name="GenerateNew"
078: * @generated
079: * @ordered
080: */
081: public static final int GENERATE_NEW = 2;
082:
083: /**
084: * The '<em><b>Use Existing</b></em>' literal object.
085: * <!-- begin-user-doc -->
086: * <!-- end-user-doc -->
087: * @see #USE_EXISTING
088: * @generated
089: * @ordered
090: */
091: public static final IdentifierGenerationOptionType USE_EXISTING_LITERAL = new IdentifierGenerationOptionType(
092: USE_EXISTING, "UseExisting", "UseExisting");
093:
094: /**
095: * The '<em><b>Replace Duplicate</b></em>' literal object.
096: * <!-- begin-user-doc -->
097: * <!-- end-user-doc -->
098: * @see #REPLACE_DUPLICATE
099: * @generated
100: * @ordered
101: */
102: public static final IdentifierGenerationOptionType REPLACE_DUPLICATE_LITERAL = new IdentifierGenerationOptionType(
103: REPLACE_DUPLICATE, "ReplaceDuplicate", "ReplaceDuplicate");
104:
105: /**
106: * The '<em><b>Generate New</b></em>' literal object.
107: * <!-- begin-user-doc -->
108: * <!-- end-user-doc -->
109: * @see #GENERATE_NEW
110: * @generated
111: * @ordered
112: */
113: public static final IdentifierGenerationOptionType GENERATE_NEW_LITERAL = new IdentifierGenerationOptionType(
114: GENERATE_NEW, "GenerateNew", "GenerateNew");
115:
116: /**
117: * An array of all the '<em><b>Identifier Generation Option Type</b></em>' enumerators.
118: * <!-- begin-user-doc -->
119: * <!-- end-user-doc -->
120: * @generated
121: */
122: private static final IdentifierGenerationOptionType[] VALUES_ARRAY = new IdentifierGenerationOptionType[] {
123: USE_EXISTING_LITERAL, REPLACE_DUPLICATE_LITERAL,
124: GENERATE_NEW_LITERAL, };
125:
126: /**
127: * A public read-only list of all the '<em><b>Identifier Generation Option Type</b></em>' enumerators.
128: * <!-- begin-user-doc -->
129: * <!-- end-user-doc -->
130: * @generated
131: */
132: public static final List VALUES = Collections
133: .unmodifiableList(Arrays.asList(VALUES_ARRAY));
134:
135: /**
136: * Returns the '<em><b>Identifier Generation Option Type</b></em>' literal with the specified literal value.
137: * <!-- begin-user-doc -->
138: * <!-- end-user-doc -->
139: * @generated
140: */
141: public static IdentifierGenerationOptionType get(String literal) {
142: for (int i = 0; i < VALUES_ARRAY.length; ++i) {
143: IdentifierGenerationOptionType result = VALUES_ARRAY[i];
144: if (result.toString().equals(literal)) {
145: return result;
146: }
147: }
148: return null;
149: }
150:
151: /**
152: * Returns the '<em><b>Identifier Generation Option Type</b></em>' literal with the specified name.
153: * <!-- begin-user-doc -->
154: * <!-- end-user-doc -->
155: * @generated
156: */
157: public static IdentifierGenerationOptionType getByName(String name) {
158: for (int i = 0; i < VALUES_ARRAY.length; ++i) {
159: IdentifierGenerationOptionType result = VALUES_ARRAY[i];
160: if (result.getName().equals(name)) {
161: return result;
162: }
163: }
164: return null;
165: }
166:
167: /**
168: * Returns the '<em><b>Identifier Generation Option Type</b></em>' literal with the specified integer value.
169: * <!-- begin-user-doc -->
170: * <!-- end-user-doc -->
171: * @generated
172: */
173: public static IdentifierGenerationOptionType get(int value) {
174: switch (value) {
175: case USE_EXISTING:
176: return USE_EXISTING_LITERAL;
177: case REPLACE_DUPLICATE:
178: return REPLACE_DUPLICATE_LITERAL;
179: case GENERATE_NEW:
180: return GENERATE_NEW_LITERAL;
181: }
182: return null;
183: }
184:
185: /**
186: * Only this class can construct instances.
187: * <!-- begin-user-doc -->
188: * <!-- end-user-doc -->
189: * @generated
190: */
191: private IdentifierGenerationOptionType(int value, String name,
192: String literal) {
193: super (value, name, literal);
194: }
195:
196: } //IdentifierGenerationOptionType
|