package org.eclipse.emf.texo.test.model.samples.library; /** * A representation of the literals of the enumeration 'BookCategory'. * * * @generated */ @org.eclipse.emf.texo.test.models.annotations.TestAnnotationOne("enum") public enum BookCategory { /** * The enum: MYSTERY * * * @generated */ @org.eclipse.emf.texo.test.models.annotations.TestAnnotationOne("enum") /** */ MYSTERY(0, "Mystery", "Mystery") { /** * @return always true for this instance * @generated */ @Override public boolean isMystery() { return true; } }, /** * The enum: SCIENCEFICTION * * * @generated */ /** */ SCIENCEFICTION(1, "ScienceFiction", "ScienceFiction") { /** * @return always true for this instance * @generated */ @Override public boolean isScienceFiction() { return true; } }, /** * The enum: BIOGRAPHY * * * @generated */ /** */ BIOGRAPHY(2, "Biography", "Biography") { /** * @return always true for this instance * @generated */ @Override public boolean isBiography() { return true; } } ; /** * An array of all the 'BookCategory' enumerators. * * * @generated */ private static final BookCategory[] VALUES_ARRAY = new BookCategory[] { MYSTERY, SCIENCEFICTION, BIOGRAPHY }; /** * A public read-only list of all the 'BookCategory' enumerators. * * * @generated */ public static final java.util.List VALUES = java.util.Collections.unmodifiableList(java.util.Arrays.asList(VALUES_ARRAY)); /** * Returns the 'BookCategory' literal with the specified literal value. * * * * @param literal the literal to use to get the enum instance * @return the BookCategory, the literal enum class * @generated */ public static BookCategory get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { BookCategory result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the 'BookCategory' literal with the specified name. * * * @param name the name to use to get the enum instance * @return the BookCategory, the literal enum class * @generated */ public static BookCategory getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { BookCategory result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the 'BookCategory' literal with the specified integer value. * * * @param value the value to use to get the enum instance * @return the BookCategory, the literal enum * @generated */ public static BookCategory get(int value) { for (BookCategory enumInstance : VALUES_ARRAY) { if (enumInstance.getValue() == value) { return enumInstance; } } 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 BookCategory(int value, String name, String literal) { this.value = value; this.name = name; this.literal = literal; } /** * * * @return false, is overridden by actual enum types. * @generated */ public boolean isMystery() { return false; } /** * * * @return false, is overridden by actual enum types. * @generated */ public boolean isScienceFiction() { return false; } /** * * * @return false, is overridden by actual enum types. * @generated */ public boolean isBiography() { return false; } /** * * * @return the value * @generated */ public int getValue() { return value; } /** * * * @return the name * @generated */ public String getName() { return name; } /** * * * @return the literal of this enum instance * @generated */ public String getLiteral() { return literal; } /** * * * @return the literal value of the enumerator, which is its string representation. * @generated */ @Override public String toString() { return literal; } }