use of org.yakindu.base.expressions.expressions.StringLiteral in project statecharts by Yakindu.
the class Assert method assertExpressionEquals.
public static void assertExpressionEquals(String expected, Expression current) {
String currentValue = null;
if (current instanceof PrimitiveValueExpression) {
Literal literal = ((PrimitiveValueExpression) current).getValue();
if (literal instanceof BoolLiteral) {
currentValue = Boolean.toString(((BoolLiteral) literal).isValue());
} else if (literal instanceof IntLiteral) {
currentValue = Long.toString(((IntLiteral) literal).getValue());
} else if (literal instanceof DoubleLiteral) {
currentValue = Double.toString(((DoubleLiteral) literal).getValue());
} else if (literal instanceof FloatLiteral) {
currentValue = Double.toString(((FloatLiteral) literal).getValue());
} else if (literal instanceof StringLiteral) {
currentValue = (((StringLiteral) literal).getValue());
}
}
assertEquals(expected, currentValue);
}
use of org.yakindu.base.expressions.expressions.StringLiteral in project statecharts by Yakindu.
the class FeatureParameterValueImpl method setValue.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void setValue(String string) {
StringLiteral stringLiteral = ExpressionsFactory.eINSTANCE.createStringLiteral();
stringLiteral.setValue(string);
setValue(stringLiteral);
}
Aggregations