
org.bimserver.models.store.PrimitiveEnum Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of PluginBase Show documentation
Show all versions of PluginBase Show documentation
Base project for BIMserver plugin development. Some plugins mights also need the Shared library
/**
* Copyright (C) 2009-2014 BIMserver.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
package org.bimserver.models.store;
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 'Primitive Enum',
* and utility methods for working with them.
*
* @see org.bimserver.models.store.StorePackage#getPrimitiveEnum()
* @model
* @generated
*/
public enum PrimitiveEnum implements Enumerator {
/**
* The 'LONG' literal object.
*
*
* @see #LONG_VALUE
* @generated
* @ordered
*/
LONG(0, "LONG", "LONG"),
/**
* The 'DOUBLE' literal object.
*
*
* @see #DOUBLE_VALUE
* @generated
* @ordered
*/
DOUBLE(1, "DOUBLE", "DOUBLE"),
/**
* The 'BOOLEAN' literal object.
*
*
* @see #BOOLEAN_VALUE
* @generated
* @ordered
*/
BOOLEAN(2, "BOOLEAN", "BOOLEAN"),
/**
* The 'STRING' literal object.
*
*
* @see #STRING_VALUE
* @generated
* @ordered
*/
STRING(3, "STRING", "STRING"),
/**
* The 'BYTE ARRAY' literal object.
*
*
* @see #BYTE_ARRAY_VALUE
* @generated
* @ordered
*/
BYTE_ARRAY(4, "BYTE_ARRAY", "BYTE_ARRAY");
/**
* The 'LONG' literal value.
*
*
* If the meaning of 'LONG' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #LONG
* @model
* @generated
* @ordered
*/
public static final int LONG_VALUE = 0;
/**
* The 'DOUBLE' literal value.
*
*
* If the meaning of 'DOUBLE' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #DOUBLE
* @model
* @generated
* @ordered
*/
public static final int DOUBLE_VALUE = 1;
/**
* The 'BOOLEAN' literal value.
*
*
* If the meaning of 'BOOLEAN' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #BOOLEAN
* @model
* @generated
* @ordered
*/
public static final int BOOLEAN_VALUE = 2;
/**
* The 'STRING' literal value.
*
*
* If the meaning of 'STRING' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #STRING
* @model
* @generated
* @ordered
*/
public static final int STRING_VALUE = 3;
/**
* The 'BYTE ARRAY' literal value.
*
*
* If the meaning of 'BYTE ARRAY' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #BYTE_ARRAY
* @model
* @generated
* @ordered
*/
public static final int BYTE_ARRAY_VALUE = 4;
/**
* An array of all the 'Primitive Enum' enumerators.
*
*
* @generated
*/
private static final PrimitiveEnum[] VALUES_ARRAY = new PrimitiveEnum[] { LONG, DOUBLE, BOOLEAN, STRING, BYTE_ARRAY, };
/**
* A public read-only list of all the 'Primitive Enum' enumerators.
*
*
* @generated
*/
public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the 'Primitive Enum' literal with the specified literal value.
*
*
* @param literal the literal.
* @return the matching enumerator or null
.
* @generated
*/
public static PrimitiveEnum get(String literal) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
PrimitiveEnum result = VALUES_ARRAY[i];
if (result.toString().equals(literal)) {
return result;
}
}
return null;
}
/**
* Returns the 'Primitive Enum' literal with the specified name.
*
*
* @param name the name.
* @return the matching enumerator or null
.
* @generated
*/
public static PrimitiveEnum getByName(String name) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
PrimitiveEnum result = VALUES_ARRAY[i];
if (result.getName().equals(name)) {
return result;
}
}
return null;
}
/**
* Returns the 'Primitive Enum' literal with the specified integer value.
*
*
* @param value the integer value.
* @return the matching enumerator or null
.
* @generated
*/
public static PrimitiveEnum get(int value) {
switch (value) {
case LONG_VALUE:
return LONG;
case DOUBLE_VALUE:
return DOUBLE;
case BOOLEAN_VALUE:
return BOOLEAN;
case STRING_VALUE:
return STRING;
case BYTE_ARRAY_VALUE:
return BYTE_ARRAY;
}
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 PrimitiveEnum(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;
}
} //PrimitiveEnum
© 2015 - 2025 Weber Informatics LLC | Privacy Policy