org.eclipse.uml2.uml.ConnectorKind Maven / Gradle / Ivy
The newest version!
/*
* Copyright (c) 2006, 2014 IBM Corporation, CEA, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - initial API and implementation
* Christian W. Damus (CEA) - 251963
* Kenn Hussey (CEA) - 418466
*
*/
package org.eclipse.uml2.uml;
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 'Connector Kind',
* and utility methods for working with them.
*
*
* ConnectorKind is an enumeration that defines whether a Connector is an assembly or a delegation.
* From package UML::StructuredClassifiers.
*
* @see org.eclipse.uml2.uml.UMLPackage#getConnectorKind()
* @model
* @generated
*/
public enum ConnectorKind
implements Enumerator {
/**
* The 'Assembly' literal object.
*
*
* @see #ASSEMBLY
* @generated
* @ordered
*/
ASSEMBLY_LITERAL(0, "assembly", "assembly"), //$NON-NLS-1$ //$NON-NLS-2$
/**
* The 'Delegation' literal object.
*
*
* @see #DELEGATION
* @generated
* @ordered
*/
DELEGATION_LITERAL(1, "delegation", "delegation"); //$NON-NLS-1$ //$NON-NLS-2$
/**
* The 'Assembly' literal value.
*
*
*
* Indicates that the Connector is an assembly Connector.
*
* @see #ASSEMBLY_LITERAL
* @model name="assembly"
* @generated
* @ordered
*/
public static final int ASSEMBLY = 0;
/**
* The 'Delegation' literal value.
*
*
*
* Indicates that the Connector is a delegation Connector.
*
* @see #DELEGATION_LITERAL
* @model name="delegation"
* @generated
* @ordered
*/
public static final int DELEGATION = 1;
/**
* An array of all the 'Connector Kind' enumerators.
*
*
* @generated
*/
private static final ConnectorKind[] VALUES_ARRAY = new ConnectorKind[]{
ASSEMBLY_LITERAL, DELEGATION_LITERAL,};
/**
* A public read-only list of all the 'Connector Kind' enumerators.
*
*
* @generated
*/
public static final List VALUES = Collections
.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the 'Connector Kind' literal with the specified literal value.
*
*
* @generated
*/
public static ConnectorKind get(String literal) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
ConnectorKind result = VALUES_ARRAY[i];
if (result.toString().equals(literal)) {
return result;
}
}
return null;
}
/**
* Returns the 'Connector Kind' literal with the specified name.
*
*
* @generated
*/
public static ConnectorKind getByName(String name) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
ConnectorKind result = VALUES_ARRAY[i];
if (result.getName().equals(name)) {
return result;
}
}
return null;
}
/**
* Returns the 'Connector Kind' literal with the specified integer value.
*
*
* @generated
*/
public static ConnectorKind get(int value) {
switch (value) {
case ASSEMBLY :
return ASSEMBLY_LITERAL;
case DELEGATION :
return DELEGATION_LITERAL;
}
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 ConnectorKind(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;
}
} //ConnectorKind