org.contextmapper.tactic.dsl.tacticdsl.Visibility Maven / Gradle / Ivy
/**
* generated by Xtext 2.20.0
*/
package org.contextmapper.tactic.dsl.tacticdsl;
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 'Visibility',
* and utility methods for working with them.
*
* @see org.contextmapper.tactic.dsl.tacticdsl.TacticdslPackage#getVisibility()
* @model
* @generated
*/
public enum Visibility implements Enumerator
{
/**
* The 'Public' literal object.
*
*
* @see #PUBLIC_VALUE
* @generated
* @ordered
*/
PUBLIC(0, "public", "public"),
/**
* The 'Protected' literal object.
*
*
* @see #PROTECTED_VALUE
* @generated
* @ordered
*/
PROTECTED(1, "protected", "protected"),
/**
* The 'Private' literal object.
*
*
* @see #PRIVATE_VALUE
* @generated
* @ordered
*/
PRIVATE(2, "private", "private"),
/**
* The 'Package' literal object.
*
*
* @see #PACKAGE_VALUE
* @generated
* @ordered
*/
PACKAGE(3, "package", "package");
/**
* The 'Public' literal value.
*
*
* If the meaning of 'Public' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #PUBLIC
* @model name="public"
* @generated
* @ordered
*/
public static final int PUBLIC_VALUE = 0;
/**
* The 'Protected' literal value.
*
*
* If the meaning of 'Protected' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #PROTECTED
* @model name="protected"
* @generated
* @ordered
*/
public static final int PROTECTED_VALUE = 1;
/**
* The 'Private' literal value.
*
*
* If the meaning of 'Private' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #PRIVATE
* @model name="private"
* @generated
* @ordered
*/
public static final int PRIVATE_VALUE = 2;
/**
* The 'Package' literal value.
*
*
* If the meaning of 'Package' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #PACKAGE
* @model name="package"
* @generated
* @ordered
*/
public static final int PACKAGE_VALUE = 3;
/**
* An array of all the 'Visibility' enumerators.
*
*
* @generated
*/
private static final Visibility[] VALUES_ARRAY =
new Visibility[]
{
PUBLIC,
PROTECTED,
PRIVATE,
PACKAGE,
};
/**
* A public read-only list of all the 'Visibility' enumerators.
*
*
* @generated
*/
public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the 'Visibility' literal with the specified literal value.
*
*
* @param literal the literal.
* @return the matching enumerator or null
.
* @generated
*/
public static Visibility get(String literal)
{
for (int i = 0; i < VALUES_ARRAY.length; ++i)
{
Visibility result = VALUES_ARRAY[i];
if (result.toString().equals(literal))
{
return result;
}
}
return null;
}
/**
* Returns the 'Visibility' literal with the specified name.
*
*
* @param name the name.
* @return the matching enumerator or null
.
* @generated
*/
public static Visibility getByName(String name)
{
for (int i = 0; i < VALUES_ARRAY.length; ++i)
{
Visibility result = VALUES_ARRAY[i];
if (result.getName().equals(name))
{
return result;
}
}
return null;
}
/**
* Returns the 'Visibility' literal with the specified integer value.
*
*
* @param value the integer value.
* @return the matching enumerator or null
.
* @generated
*/
public static Visibility get(int value)
{
switch (value)
{
case PUBLIC_VALUE: return PUBLIC;
case PROTECTED_VALUE: return PROTECTED;
case PRIVATE_VALUE: return PRIVATE;
case PACKAGE_VALUE: return PACKAGE;
}
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 Visibility(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;
}
} //Visibility