use of org.talend.hadoop.distribution.condition.BooleanExpression in project tbd-studio-se by Talend.
the class DistributionVersion method getDisplayShowIf.
public String getDisplayShowIf() {
final Expression trueExp = new BooleanExpression(true);
final Expression falseExp = new BooleanExpression(false);
ComponentCondition additionalCondition = displayCondition;
if (additionalCondition != null && (trueExp.getExpressionString().equals(additionalCondition.getConditionString()) || falseExp.getExpressionString().equals(additionalCondition.getConditionString()))) {
// Don't show a version if it's display condition is a BooleanCondition.
return trueExp.getExpressionString().equals(additionalCondition.getConditionString()) ? Boolean.TRUE.toString() : Boolean.FALSE.toString();
} else {
// Compose the ComponentCondition to display a version.
ComponentCondition condition;
org.talend.hadoop.distribution.condition.Expression e = new BasicExpression(distribution.componentType.getDistributionParameter(), EqualityOperator.EQ, distribution.name);
if (additionalCondition != null) {
condition = new MultiComponentCondition(new SimpleComponentCondition(e), BooleanOperator.AND, new NestedComponentCondition(additionalCondition));
} else {
condition = new SimpleComponentCondition(e);
}
return condition.getConditionString();
}
}
Aggregations