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