blob: a21c66d68161c60b3f10c2940095cfa3c4a1abe1 [file] [log] [blame]
/*******************************************************************************
* 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;
import static org.eclipse.jpt.core.internal.AccessType.DEFAULT_VALUE;
import static org.eclipse.jpt.core.internal.AccessType.FIELD_VALUE;
import static org.eclipse.jpt.core.internal.AccessType.PROPERTY_VALUE;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.eclipse.emf.common.util.Enumerator;
/**
* <!-- begin-user-doc -->
* A representation of the literals of the enumeration '<em><b>Access Type</b></em>',
* and utility methods for working with them.
* <!-- end-user-doc -->
* @see org.eclipse.jpt.core.internal.JpaCorePackage#getAccessType()
* @model
* @generated
*/
public enum AccessType implements Enumerator {
/**
* The '<em><b>Default</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #DEFAULT_VALUE
* @generated
* @ordered
*/
DEFAULT(0, "Default", "Default"),
/**
* The '<em><b>PROPERTY</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #PROPERTY_VALUE
* @generated
* @ordered
*/
PROPERTY(1, "PROPERTY", "Property"),
/**
* The '<em><b>FIELD</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #FIELD_VALUE
* @generated
* @ordered
*/
FIELD(2, "FIELD", "Field");
/**
* The '<em><b>Default</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Default</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #DEFAULT
* @model name="Default"
* @generated
* @ordered
*/
public static final int DEFAULT_VALUE = 0;
/**
* The '<em><b>PROPERTY</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>PROPERTY</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #PROPERTY
* @model literal="Property"
* @generated
* @ordered
*/
public static final int PROPERTY_VALUE = 1;
/**
* The '<em><b>FIELD</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>FIELD</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #FIELD
* @model literal="Field"
* @generated
* @ordered
*/
public static final int FIELD_VALUE = 2;
/**
* An array of all the '<em><b>Access Type</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static final AccessType[] VALUES_ARRAY = new AccessType[] {
DEFAULT, PROPERTY, FIELD,
};
/**
* A public read-only list of all the '<em><b>Access Type</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final List<AccessType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the '<em><b>Access Type</b></em>' literal with the specified literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static AccessType get(String literal) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
AccessType result = VALUES_ARRAY[i];
if (result.toString().equals(literal)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Access Type</b></em>' literal with the specified name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static AccessType getByName(String name) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
AccessType result = VALUES_ARRAY[i];
if (result.getName().equals(name)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Access Type</b></em>' literal with the specified integer value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static AccessType get(int value) {
switch (value) {
case DEFAULT_VALUE :
return DEFAULT;
case PROPERTY_VALUE :
return PROPERTY;
case FIELD_VALUE :
return FIELD;
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final int value;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final String name;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final String literal;
/**
* Only this class can construct instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private AccessType(int value, String name, String literal) {
this.value = value;
this.name = name;
this.literal = literal;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getLiteral() {
return literal;
}
/**
* Returns the literal value of the enumerator, which is its string representation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
return literal;
}
} //AccessType