AggregationType.java

// license-header java merge-point
//
// Attention: Generated code! Do not modify by hand!
// Generated by: TypeSafeEnumeration.vsl in andromda-java-cartridge.
// Model Class:  JDBCMetadataModel::org.andromda.jdbcmetadata::AggregationType
// Metafacade:   org.andromda.metafacades.uml.Enumeration
//
package org.andromda.jdbcmetadata;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * TODO: Model Documentation for org.andromda.jdbcmetadata.AggregationType
 */
public enum AggregationType
{
    /** TODO: Model Documentation for Enumeration Literal SHARED value "SHARED" */
    SHARED("SHARED"),
    /** TODO: Model Documentation for Enumeration Literal COMPOSITE value "COMPOSITE" */
    COMPOSITE("COMPOSITE"),
    /** TODO: Model Documentation for Enumeration Literal NONE value "NONE" */
    NONE("NONE");

    /**
     * The serial version UID of this class. Needed for serialization.
     */
    private static final long serialVersionUID = -7604792007413553450L;

    private final String enumValue;

    /**
     * The constructor with enumeration literal value allowing
     * super classes to access it.
     */
    private AggregationType(String value)
    {
        this.enumValue = value;
    }

    /*
     * Do not override this method directly. Use an alternate name
     * if providing a different toString implementation
     * @see Object#toString()
    @Override
    public String toString()
    {
        return String.valueOf(this.enumValue);
    }
     */

    /**
     * Retrieves an instance of AggregationType from <code>its name</code>.
     *
     * @param name the name to create the AggregationType from.
     * @return The enumeration literal named after the 'name' argument
     */
    public static AggregationType fromString(String name)
    {
        return AggregationType.valueOf(name);
    }

    /**
     * Returns an enumeration literal String <code>value</code>.
     * Required by JAXB2 enumeration implementation
     *
     * @return String with corresponding value
     */
    public String value()
    {
        return this.enumValue;
    }

    /**
     * Returns an instance of AggregationType from String <code>value</code>.
     * Required by JAXB2 enumeration implementation
     *
     * @param value the value to create the AggregationType from.
     * @return static Enumeration with corresponding value
     */
    public static AggregationType fromValue(String value)
    {
        for (AggregationType enumName: AggregationType.values())
        {
            if (enumName.getValue().equals(value))
            {
                return enumName;
            }
        }
        throw new IllegalArgumentException("AggregationType.fromValue(" + value + ')');
    }

    /**
     * Gets the underlying value of this type safe enumeration.
     * This method is necessary to comply with DaoBase implementation.
     * @return The name of this literal.
     */
    public String getValue()
    {
        return this.enumValue;
    }

    /**
     * Returns an unmodifiable list containing the literals that are known by this enumeration.
     *
     * @return A List containing the actual literals defined by this enumeration, this list
     *         can not be modified.
     */
    public static List<String> literals()
    {
        return AggregationType.literals;
    }

    /**
     * Returns an unmodifiable list containing the names of the literals that are known
     * by this enumeration.
     *
     * @return A List containing the actual names of the literals defined by this
     *         enumeration, this list can not be modified.
     */
    public static List<String> names()
    {
        return AggregationType.names;
    }

    private static Map<String, AggregationType> values = new LinkedHashMap<String, AggregationType>(3, 1);
    private static List<String> literals = new ArrayList<String>(3);
    private static List<String> names = new ArrayList<String>(3);
    private static List<AggregationType> valueList = new ArrayList<AggregationType>(3);

    /**
     * Initializes the values.
     */
    static
    {
        synchronized (AggregationType.values)
        {
            AggregationType.values.put(SHARED.enumValue, SHARED);
            AggregationType.values.put(COMPOSITE.enumValue, COMPOSITE);
            AggregationType.values.put(NONE.enumValue, NONE);
        }
        synchronized (AggregationType.valueList)
        {
            AggregationType.valueList.add(SHARED);
            AggregationType.valueList.add(COMPOSITE);
            AggregationType.valueList.add(NONE);
            AggregationType.valueList = Collections.unmodifiableList(valueList);
        }
        synchronized (AggregationType.literals)
        {
            AggregationType.literals.add(SHARED.enumValue);
            AggregationType.literals.add(COMPOSITE.enumValue);
            AggregationType.literals.add(NONE.enumValue);
            AggregationType.literals = Collections.unmodifiableList(literals);
        }
        synchronized (AggregationType.names)
        {
            AggregationType.names.add("SHARED");
            AggregationType.names.add("COMPOSITE");
            AggregationType.names.add("NONE");
            AggregationType.names = Collections.unmodifiableList(names);
        }
    }
    // type-safe-enumeration-object java merge-point
}