org.contextmapper.dsl.contextMappingDSL.ContextMapState Maven / Gradle / Ivy
/**
* generated by Xtext 2.20.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 'AS IS' literal object.
*
*
* @see #AS_IS_VALUE
* @generated
* @ordered
*/
AS_IS(0, "AS_IS", "AS_IS"),
/**
* The 'TO BE' literal object.
*
*
* @see #TO_BE_VALUE
* @generated
* @ordered
*/
TO_BE(1, "TO_BE", "TO_BE");
/**
* The 'AS IS' literal value.
*
*
* If the meaning of 'AS IS' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #AS_IS
* @model
* @generated
* @ordered
*/
public static final int AS_IS_VALUE = 0;
/**
* The 'TO BE' literal value.
*
*
* If the meaning of 'TO BE' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #TO_BE
* @model
* @generated
* @ordered
*/
public static final int TO_BE_VALUE = 1;
/**
* An array of all the 'Context Map State' enumerators.
*
*
* @generated
*/
private static final ContextMapState[] VALUES_ARRAY =
new ContextMapState[]
{
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 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
*/
public int getValue()
{
return value;
}
/**
*
*
* @generated
*/
public String getName()
{
return name;
}
/**
*
*
* @generated
*/
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