blob: 4f6a71f558279db9b045c375b96b120fc5cff698 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2014 Bosch Software Innovations GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
* The Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Bosch Software Innovations GmbH - Please refer to git log
*
*******************************************************************************/
/**
*/
package org.eclipse.vorto.functionblock;
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>Primitive Type</b></em>',
* and utility methods for working with them.
* <!-- end-user-doc -->
* @see org.eclipse.vorto.functionblock.FunctionblockPackage#getPrimitiveType()
* @model
* @generated
*/
public enum PrimitiveType implements Enumerator {
/**
* The '<em><b>String</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #STRING_VALUE
* @generated
* @ordered
*/
STRING(0, "string", "string"),
/**
* The '<em><b>Int</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #INT_VALUE
* @generated
* @ordered
*/
INT(1, "int", "int"),
/**
* The '<em><b>Float</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #FLOAT_VALUE
* @generated
* @ordered
*/
FLOAT(2, "float", "float"),
/**
* The '<em><b>Boolean</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #BOOLEAN_VALUE
* @generated
* @ordered
*/
BOOLEAN(3, "boolean", "boolean"),
/**
* The '<em><b>Datetime</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #DATETIME_VALUE
* @generated
* @ordered
*/
DATETIME(4, "datetime", "dateTime"),
/**
* The '<em><b>Double</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #DOUBLE_VALUE
* @generated
* @ordered
*/
DOUBLE(5, "double", "double"),
/**
* The '<em><b>Long</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #LONG_VALUE
* @generated
* @ordered
*/
LONG(6, "long", "long"),
/**
* The '<em><b>Short</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #SHORT_VALUE
* @generated
* @ordered
*/
SHORT(7, "short", "short"),
/**
* The '<em><b>Base64 Binary</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #BASE64_BINARY_VALUE
* @generated
* @ordered
*/
BASE64_BINARY(8, "base64Binary", "base64Binary"),
/**
* The '<em><b>Byte</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #BYTE_VALUE
* @generated
* @ordered
*/
BYTE(9, "byte", "byte");
/**
* The '<em><b>String</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>String</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #STRING
* @model name="string"
* @generated
* @ordered
*/
public static final int STRING_VALUE = 0;
/**
* The '<em><b>Int</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Int</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #INT
* @model name="int"
* @generated
* @ordered
*/
public static final int INT_VALUE = 1;
/**
* The '<em><b>Float</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Float</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #FLOAT
* @model name="float"
* @generated
* @ordered
*/
public static final int FLOAT_VALUE = 2;
/**
* The '<em><b>Boolean</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Boolean</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #BOOLEAN
* @model name="boolean"
* @generated
* @ordered
*/
public static final int BOOLEAN_VALUE = 3;
/**
* The '<em><b>Datetime</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Datetime</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #DATETIME
* @model name="datetime" literal="dateTime"
* @generated
* @ordered
*/
public static final int DATETIME_VALUE = 4;
/**
* The '<em><b>Double</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Double</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #DOUBLE
* @model name="double"
* @generated
* @ordered
*/
public static final int DOUBLE_VALUE = 5;
/**
* The '<em><b>Long</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Long</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #LONG
* @model name="long"
* @generated
* @ordered
*/
public static final int LONG_VALUE = 6;
/**
* The '<em><b>Short</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Short</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #SHORT
* @model name="short"
* @generated
* @ordered
*/
public static final int SHORT_VALUE = 7;
/**
* The '<em><b>Base64 Binary</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Base64 Binary</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #BASE64_BINARY
* @model name="base64Binary"
* @generated
* @ordered
*/
public static final int BASE64_BINARY_VALUE = 8;
/**
* The '<em><b>Byte</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Byte</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #BYTE
* @model name="byte"
* @generated
* @ordered
*/
public static final int BYTE_VALUE = 9;
/**
* An array of all the '<em><b>Primitive Type</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static final PrimitiveType[] VALUES_ARRAY =
new PrimitiveType[] {
STRING,
INT,
FLOAT,
BOOLEAN,
DATETIME,
DOUBLE,
LONG,
SHORT,
BASE64_BINARY,
BYTE,
};
/**
* A public read-only list of all the '<em><b>Primitive Type</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final List<PrimitiveType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the '<em><b>Primitive Type</b></em>' literal with the specified literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static PrimitiveType get(String literal) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
PrimitiveType result = VALUES_ARRAY[i];
if (result.toString().equals(literal)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Primitive Type</b></em>' literal with the specified name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static PrimitiveType getByName(String name) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
PrimitiveType result = VALUES_ARRAY[i];
if (result.getName().equals(name)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Primitive Type</b></em>' literal with the specified integer value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static PrimitiveType get(int value) {
switch (value) {
case STRING_VALUE: return STRING;
case INT_VALUE: return INT;
case FLOAT_VALUE: return FLOAT;
case BOOLEAN_VALUE: return BOOLEAN;
case DATETIME_VALUE: return DATETIME;
case DOUBLE_VALUE: return DOUBLE;
case LONG_VALUE: return LONG;
case SHORT_VALUE: return SHORT;
case BASE64_BINARY_VALUE: return BASE64_BINARY;
case BYTE_VALUE: return BYTE;
}
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 PrimitiveType(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;
}
} //PrimitiveType