org.contextmapper.dsl.contextMappingDSL.UpstreamRole 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 'Upstream Role',
* and utility methods for working with them.
*
* @see org.contextmapper.dsl.contextMappingDSL.ContextMappingDSLPackage#getUpstreamRole()
* @model
* @generated
*/
public enum UpstreamRole implements Enumerator
{
/**
* The 'PUBLISHED LANGUAGE' literal object.
*
*
* @see #PUBLISHED_LANGUAGE_VALUE
* @generated
* @ordered
*/
PUBLISHED_LANGUAGE(0, "PUBLISHED_LANGUAGE", "PL"),
/**
* The 'OPEN HOST SERVICE' literal object.
*
*
* @see #OPEN_HOST_SERVICE_VALUE
* @generated
* @ordered
*/
OPEN_HOST_SERVICE(1, "OPEN_HOST_SERVICE", "OHS");
/**
* The 'PUBLISHED LANGUAGE' literal value.
*
*
* If the meaning of 'PUBLISHED LANGUAGE' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #PUBLISHED_LANGUAGE
* @model literal="PL"
* @generated
* @ordered
*/
public static final int PUBLISHED_LANGUAGE_VALUE = 0;
/**
* The 'OPEN HOST SERVICE' literal value.
*
*
* If the meaning of 'OPEN HOST SERVICE' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #OPEN_HOST_SERVICE
* @model literal="OHS"
* @generated
* @ordered
*/
public static final int OPEN_HOST_SERVICE_VALUE = 1;
/**
* An array of all the 'Upstream Role' enumerators.
*
*
* @generated
*/
private static final UpstreamRole[] VALUES_ARRAY =
new UpstreamRole[]
{
PUBLISHED_LANGUAGE,
OPEN_HOST_SERVICE,
};
/**
* A public read-only list of all the 'Upstream Role' enumerators.
*
*
* @generated
*/
public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the 'Upstream Role' literal with the specified literal value.
*
*
* @param literal the literal.
* @return the matching enumerator or null
.
* @generated
*/
public static UpstreamRole get(String literal)
{
for (int i = 0; i < VALUES_ARRAY.length; ++i)
{
UpstreamRole result = VALUES_ARRAY[i];
if (result.toString().equals(literal))
{
return result;
}
}
return null;
}
/**
* Returns the 'Upstream Role' literal with the specified name.
*
*
* @param name the name.
* @return the matching enumerator or null
.
* @generated
*/
public static UpstreamRole getByName(String name)
{
for (int i = 0; i < VALUES_ARRAY.length; ++i)
{
UpstreamRole result = VALUES_ARRAY[i];
if (result.getName().equals(name))
{
return result;
}
}
return null;
}
/**
* Returns the 'Upstream Role' literal with the specified integer value.
*
*
* @param value the integer value.
* @return the matching enumerator or null
.
* @generated
*/
public static UpstreamRole get(int value)
{
switch (value)
{
case PUBLISHED_LANGUAGE_VALUE: return PUBLISHED_LANGUAGE;
case OPEN_HOST_SERVICE_VALUE: return OPEN_HOST_SERVICE;
}
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 UpstreamRole(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;
}
} //UpstreamRole