All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.contextmapper.dsl.contextMappingDSL.ContextMapState Maven / Gradle / Ivy

/**
 * generated by Xtext 2.21.0
 */
package org.contextmapper.dsl.contextMappingDSL;

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 'Context Map State',
 * and utility methods for working with them.
 * 
 * @see org.contextmapper.dsl.contextMappingDSL.ContextMappingDSLPackage#getContextMapState()
 * @model
 * @generated
 */
public enum ContextMapState implements Enumerator
{
  /**
   * The 'UNDEFINED' literal object.
   * 
   * 
   * @see #UNDEFINED_VALUE
   * @generated
   * @ordered
   */
  UNDEFINED(0, "UNDEFINED", "UNDEFINED"),

  /**
   * The 'AS IS' literal object.
   * 
   * 
   * @see #AS_IS_VALUE
   * @generated
   * @ordered
   */
  AS_IS(1, "AS_IS", "AS_IS"),

  /**
   * The 'TO BE' literal object.
   * 
   * 
   * @see #TO_BE_VALUE
   * @generated
   * @ordered
   */
  TO_BE(2, "TO_BE", "TO_BE");

  /**
   * The 'UNDEFINED' literal value.
   * 
   * 
   * @see #UNDEFINED
   * @model
   * @generated
   * @ordered
   */
  public static final int UNDEFINED_VALUE = 0;

  /**
   * The 'AS IS' literal value.
   * 
   * 
   * @see #AS_IS
   * @model
   * @generated
   * @ordered
   */
  public static final int AS_IS_VALUE = 1;

  /**
   * The 'TO BE' literal value.
   * 
   * 
   * @see #TO_BE
   * @model
   * @generated
   * @ordered
   */
  public static final int TO_BE_VALUE = 2;

  /**
   * An array of all the 'Context Map State' enumerators.
   * 
   * 
   * @generated
   */
  private static final ContextMapState[] VALUES_ARRAY =
    new ContextMapState[]
    {
      UNDEFINED,
      AS_IS,
      TO_BE,
    };

  /**
   * A public read-only list of all the 'Context Map State' enumerators.
   * 
   * 
   * @generated
   */
  public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));

  /**
   * Returns the 'Context Map State' literal with the specified literal value.
   * 
   * 
   * @param literal the literal.
   * @return the matching enumerator or null.
   * @generated
   */
  public static ContextMapState get(String literal)
  {
    for (int i = 0; i < VALUES_ARRAY.length; ++i)
    {
      ContextMapState result = VALUES_ARRAY[i];
      if (result.toString().equals(literal))
      {
        return result;
      }
    }
    return null;
  }

  /**
   * Returns the 'Context Map State' literal with the specified name.
   * 
   * 
   * @param name the name.
   * @return the matching enumerator or null.
   * @generated
   */
  public static ContextMapState getByName(String name)
  {
    for (int i = 0; i < VALUES_ARRAY.length; ++i)
    {
      ContextMapState result = VALUES_ARRAY[i];
      if (result.getName().equals(name))
      {
        return result;
      }
    }
    return null;
  }

  /**
   * Returns the 'Context Map State' literal with the specified integer value.
   * 
   * 
   * @param value the integer value.
   * @return the matching enumerator or null.
   * @generated
   */
  public static ContextMapState get(int value)
  {
    switch (value)
    {
      case UNDEFINED_VALUE: return UNDEFINED;
      case AS_IS_VALUE: return AS_IS;
      case TO_BE_VALUE: return TO_BE;
    }
    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 ContextMapState(int value, String name, String literal)
  {
    this.value = value;
    this.name = name;
    this.literal = literal;
  }

  /**
   * 
   * 
   * @generated
   */
  @Override
  public int getValue()
  {
    return value;
  }

  /**
   * 
   * 
   * @generated
   */
  @Override
  public String getName()
  {
    return name;
  }

  /**
   * 
   * 
   * @generated
   */
  @Override
  public String getLiteral()
  {
    return literal;
  }

  /**
   * Returns the literal value of the enumerator, which is its string representation.
   * 
   * 
   * @generated
   */
  @Override
  public String toString()
  {
    return literal;
  }
  
} //ContextMapState




© 2015 - 2024 Weber Informatics LLC | Privacy Policy