blob: 70f3ffcce10a897608e7db2f2fef657dcc6e3447 [file] [log] [blame]
/**
* Copyright (c)2020 CEA LIST, Committer Name, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* CEA LIST - Initial API and implementation
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr
* Gabriel Pedroza (CEA LIST) gabriel.pedroza@cea.fr
*
*/
package org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.eclipse.emf.common.util.Enumerator;
/**
* <!-- begin-user-doc -->
* A representation of the literals of the enumeration '<em><b>Duration</b></em>',
* and utility methods for working with them.
* <!-- end-user-doc -->
* @see org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.pdp4engReqGDPRPackage#getDuration()
* @model
* @generated
*/
public enum Duration implements Enumerator {
/**
* The '<em><b>For Action</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #FOR_ACTION_VALUE
* @generated
* @ordered
*/
FOR_ACTION(0, "forAction", "forAction"),
/**
* The '<em><b>Until Deleted</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #UNTIL_DELETED_VALUE
* @generated
* @ordered
*/
UNTIL_DELETED(1, "untilDeleted", "untilDeleted"),
/**
* The '<em><b>Unlimited</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #UNLIMITED_VALUE
* @generated
* @ordered
*/
UNLIMITED(2, "unlimited", "unlimited");
/**
* The '<em><b>For Action</b></em>' literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #FOR_ACTION
* @model name="forAction"
* @generated
* @ordered
*/
public static final int FOR_ACTION_VALUE = 0;
/**
* The '<em><b>Until Deleted</b></em>' literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #UNTIL_DELETED
* @model name="untilDeleted"
* @generated
* @ordered
*/
public static final int UNTIL_DELETED_VALUE = 1;
/**
* The '<em><b>Unlimited</b></em>' literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #UNLIMITED
* @model name="unlimited"
* @generated
* @ordered
*/
public static final int UNLIMITED_VALUE = 2;
/**
* An array of all the '<em><b>Duration</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static final Duration[] VALUES_ARRAY =
new Duration[] {
FOR_ACTION,
UNTIL_DELETED,
UNLIMITED,
};
/**
* A public read-only list of all the '<em><b>Duration</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final List<Duration> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the '<em><b>Duration</b></em>' literal with the specified literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param literal the literal.
* @return the matching enumerator or <code>null</code>.
* @generated
*/
public static Duration get(String literal) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
Duration result = VALUES_ARRAY[i];
if (result.toString().equals(literal)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Duration</b></em>' literal with the specified name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name the name.
* @return the matching enumerator or <code>null</code>.
* @generated
*/
public static Duration getByName(String name) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
Duration result = VALUES_ARRAY[i];
if (result.getName().equals(name)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Duration</b></em>' literal with the specified integer value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the integer value.
* @return the matching enumerator or <code>null</code>.
* @generated
*/
public static Duration get(int value) {
switch (value) {
case FOR_ACTION_VALUE: return FOR_ACTION;
case UNTIL_DELETED_VALUE: return UNTIL_DELETED;
case UNLIMITED_VALUE: return UNLIMITED;
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final int value;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final String name;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final String literal;
/**
* Only this class can construct instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private Duration(int value, String name, String literal) {
this.value = value;
this.name = name;
this.literal = literal;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int getValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getLiteral() {
return literal;
}
/**
* Returns the literal value of the enumerator, which is its string representation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
return literal;
}
} //Duration