use of org.yakindu.base.expressions.expressions.BoolLiteral in project statecharts by Yakindu.
the class StextTestFactory method _createValue.
public static PrimitiveValueExpression _createValue(boolean b) {
PrimitiveValueExpression pve = ExpressionsFactory.eINSTANCE.createPrimitiveValueExpression();
BoolLiteral boolLit = ExpressionsFactory.eINSTANCE.createBoolLiteral();
boolLit.setValue(b);
pve.setValue(boolLit);
return pve;
}
use of org.yakindu.base.expressions.expressions.BoolLiteral 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.BoolLiteral in project statecharts by Yakindu.
the class FeatureParameterValueImpl method setValue.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void setValue(boolean bool) {
BoolLiteral boolLiteral = ExpressionsFactory.eINSTANCE.createBoolLiteral();
boolLiteral.setValue(bool);
setValue(boolLiteral);
}
Aggregations