package it.micegroup.voila2.cartridge.library.javaservice;

import org.eclipse.uml2.uml.Stereotype;
import org.eclipse.uml2.uml.Element;

public class StereotypeUtils {

	public static <T, Y extends Element> T getStereotypeValue(Y umlElem, String stereotypeName, String stereotypeProperty)
	{
		Stereotype stereotype = umlElem.getAppliedStereotype(stereotypeName);
		if (stereotype != null) {				
			@SuppressWarnings("unchecked")
			T value = (T)umlElem.getValue(stereotype, stereotypeProperty);
			return value;		
		}
		return null;
	}
}
