com.evuv.expressions.SmallerThanExpression Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of evuv-exp-parser Show documentation
Show all versions of evuv-exp-parser Show documentation
Boolean expression parser and evaluator
The newest version!
package com.evuv.expressions;
import java.util.Map;
import com.evuv.exceptions.EventBindingException;
import com.evuv.operators.Operator;
import com.evuv.operators.SmallerThanOperator;
public class SmallerThanExpression extends BooleanExpression {
protected SmallerThanOperator operator;
public SmallerThanExpression(ComparableExpression left, ComparableExpression right) {
super(left, right);
operator = new SmallerThanOperator();
}
@Override
public Boolean getValue() {
return operator.op(left, right);
}
@SuppressWarnings("rawtypes")
@Override
protected Operator getOperator() {
return operator;
}
@Override
public SmallerThanExpression bind(Map event) throws EventBindingException {
ComparableExpression bindedLeft = (ComparableExpression) left.bind(event);
ComparableExpression bindedRight = (ComparableExpression) right.bind(event);
return new SmallerThanExpression<>(bindedLeft, bindedRight);
}
}