001: package com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel;
002:
003: /**
004: * EntityStereotype enumeration class implementation.
005: */
006: public final class EntityStereotypeEnum implements EntityStereotype {
007: /**
008: * Enumeration constant corresponding to literal CardFile.
009: */
010: public static final EntityStereotypeEnum CARD_FILE = new EntityStereotypeEnum(
011: "CardFile");
012: /**
013: * Enumeration constant corresponding to literal LogFile.
014: */
015: public static final EntityStereotypeEnum LOG_FILE = new EntityStereotypeEnum(
016: "LogFile");
017:
018: private static final java.util.List typeName;
019: private final java.lang.String literalName;
020:
021: static {
022: java.util.ArrayList temp = new java.util.ArrayList();
023: temp.add("MetaBossModel");
024: temp.add("EnterpriseModel");
025: temp.add("SystemImplementationModel");
026: temp.add("EntityStereotype");
027: typeName = java.util.Collections.unmodifiableList(temp);
028: }
029:
030: private EntityStereotypeEnum(java.lang.String literalName) {
031: this .literalName = literalName;
032: }
033:
034: /**
035: * Returns fully qualified name of the enumeration type.
036: * @return List containing all parts of the fully qualified name.
037: */
038: public java.util.List refTypeName() {
039: return typeName;
040: }
041:
042: /**
043: * Returns a string representation of the enumeration value.
044: * @return A string representation of the enumeration value.
045: */
046: public java.lang.String toString() {
047: return literalName;
048: }
049:
050: /**
051: * Returns a hash code for this the enumeration value.
052: * @return A hash code for this enumeration value.
053: */
054: public int hashCode() {
055: return literalName.hashCode();
056: }
057:
058: /**
059: * Indicates whether some other object is equal to this enumeration value.
060: * @param o The reference object with which to compare.
061: * @return true if the other object is the enumeration of the same type and
062: * of the same value.
063: */
064: public boolean equals(java.lang.Object o) {
065: if (o instanceof EntityStereotypeEnum)
066: return (o == this );
067: else if (o instanceof EntityStereotype)
068: return (o.toString().equals(literalName));
069: else
070: return ((o instanceof javax.jmi.reflect.RefEnum)
071: && ((javax.jmi.reflect.RefEnum) o).refTypeName()
072: .equals(typeName) && o.toString().equals(
073: literalName));
074: }
075:
076: /**
077: * Translates literal name to correspondent enumeration value.
078: * @param name Enumeration literal.
079: * @return Enumeration value corresponding to the passed literal.
080: */
081: public static EntityStereotype forName(java.lang.String name) {
082: if (name.equals("CardFile"))
083: return CARD_FILE;
084: if (name.equals("LogFile"))
085: return LOG_FILE;
086: throw new java.lang.IllegalArgumentException(
087: "Unknown literal name '"
088: + name
089: + "' for enumeration 'MetaBossModel.EnterpriseModel.SystemImplementationModel.EntityStereotype'");
090: }
091:
092: /**
093: * Resolves serialized instance of enumeration value.
094: * @return Resolved enumeration value.
095: */
096: protected java.lang.Object readResolve()
097: throws java.io.ObjectStreamException {
098: try {
099: return forName(literalName);
100: } catch (java.lang.IllegalArgumentException e) {
101: throw new java.io.InvalidObjectException(e.getMessage());
102: }
103: }
104: }
|