org.contextmapper.tactic.dsl.tacticdsl.HttpMethod 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 'Http Method',
* and utility methods for working with them.
*
* @see org.contextmapper.tactic.dsl.tacticdsl.TacticdslPackage#getHttpMethod()
* @model
* @generated
*/
public enum HttpMethod implements Enumerator
{
/**
* The 'None' literal object.
*
*
* @see #NONE_VALUE
* @generated
* @ordered
*/
NONE(0, "None", "None"),
/**
* The 'GET' literal object.
*
*
* @see #GET_VALUE
* @generated
* @ordered
*/
GET(1, "GET", "GET"),
/**
* The 'POST' literal object.
*
*
* @see #POST_VALUE
* @generated
* @ordered
*/
POST(2, "POST", "POST"),
/**
* The 'PUT' literal object.
*
*
* @see #PUT_VALUE
* @generated
* @ordered
*/
PUT(3, "PUT", "PUT"),
/**
* The 'DELETE' literal object.
*
*
* @see #DELETE_VALUE
* @generated
* @ordered
*/
DELETE(4, "DELETE", "DELETE");
/**
* The 'None' literal value.
*
*
* If the meaning of 'None' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #NONE
* @model name="None"
* @generated
* @ordered
*/
public static final int NONE_VALUE = 0;
/**
* The 'GET' literal value.
*
*
* If the meaning of 'GET' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #GET
* @model
* @generated
* @ordered
*/
public static final int GET_VALUE = 1;
/**
* The 'POST' literal value.
*
*
* If the meaning of 'POST' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #POST
* @model
* @generated
* @ordered
*/
public static final int POST_VALUE = 2;
/**
* The 'PUT' literal value.
*
*
* If the meaning of 'PUT' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #PUT
* @model
* @generated
* @ordered
*/
public static final int PUT_VALUE = 3;
/**
* The 'DELETE' literal value.
*
*
* If the meaning of 'DELETE' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #DELETE
* @model
* @generated
* @ordered
*/
public static final int DELETE_VALUE = 4;
/**
* An array of all the 'Http Method' enumerators.
*
*
* @generated
*/
private static final HttpMethod[] VALUES_ARRAY =
new HttpMethod[]
{
NONE,
GET,
POST,
PUT,
DELETE,
};
/**
* A public read-only list of all the 'Http Method' enumerators.
*
*
* @generated
*/
public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the 'Http Method' literal with the specified literal value.
*
*
* @param literal the literal.
* @return the matching enumerator or null
.
* @generated
*/
public static HttpMethod get(String literal)
{
for (int i = 0; i < VALUES_ARRAY.length; ++i)
{
HttpMethod result = VALUES_ARRAY[i];
if (result.toString().equals(literal))
{
return result;
}
}
return null;
}
/**
* Returns the 'Http Method' literal with the specified name.
*
*
* @param name the name.
* @return the matching enumerator or null
.
* @generated
*/
public static HttpMethod getByName(String name)
{
for (int i = 0; i < VALUES_ARRAY.length; ++i)
{
HttpMethod result = VALUES_ARRAY[i];
if (result.getName().equals(name))
{
return result;
}
}
return null;
}
/**
* Returns the 'Http Method' literal with the specified integer value.
*
*
* @param value the integer value.
* @return the matching enumerator or null
.
* @generated
*/
public static HttpMethod get(int value)
{
switch (value)
{
case NONE_VALUE: return NONE;
case GET_VALUE: return GET;
case POST_VALUE: return POST;
case PUT_VALUE: return PUT;
case DELETE_VALUE: return DELETE;
}
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 HttpMethod(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;
}
} //HttpMethod