org.joo.libra.sql.node.NumberExpressionNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of joo-libra Show documentation
Show all versions of joo-libra Show documentation
Java Predicate with SQL-like syntax support
package org.joo.libra.sql.node;
import org.joo.libra.Predicate;
import org.joo.libra.common.SimpleLiteralPredicate;
import org.joo.libra.support.NumericComparator;
public class NumberExpressionNode extends ValueExpressionNode {
public NumberExpressionNode() {
}
public NumberExpressionNode(final Number value) {
this.value = value;
}
@Override
public Predicate buildPredicate() {
return new SimpleLiteralPredicate(value, value != null && NumericComparator.compare(value, 0) != 0);
}
public String toString() {
return value + "";
}
}