Sha256: bc0a539ee0efa243210d798db741ea6ca00a6d0c8bd62bed802f66515e3f0de2
Contents?: true
Size: 1.5 KB
Versions: 69
Compression:
Stored size: 1.5 KB
Contents
package sh.calaba.instrumentationbackend.query.ast; public enum ComparisonOperator implements UIQueryASTPredicateRelation { LESSTHAN { public boolean areRelated(Object firstValue, Object secondValue) { if (areNumbers(firstValue, secondValue)) { Number firstNum = (Number) firstValue; Number secondNum = (Number) secondValue; return firstNum.doubleValue() < secondNum.doubleValue(); } else { return false; } } }, LESSTHANOREQUAL { public boolean areRelated(Object firstValue, Object secondValue) { return EQUAL.areRelated(firstValue, secondValue) || LESSTHAN.areRelated(firstValue, secondValue); } }, EQUAL { public boolean areRelated(Object firstValue, Object secondValue) { if (firstValue == secondValue) { return true; } return (firstValue != null) && firstValue.equals(secondValue); } }, GREATERTHAN { public boolean areRelated(Object firstValue, Object secondValue) { if (areNumbers(firstValue, secondValue)) { Number firstNum = (Number) firstValue; Number secondNum = (Number) secondValue; return firstNum.doubleValue() > secondNum.doubleValue(); } else { return false; } } }, GREATERTHANOREQUAL { public boolean areRelated(Object firstValue, Object secondValue) { return EQUAL.areRelated(firstValue, secondValue) || GREATERTHAN.areRelated(firstValue, secondValue); } }; protected boolean areNumbers(Object firstValue, Object secondValue) { return (firstValue instanceof Number && secondValue instanceof Number); } }
Version data entries
69 entries across 69 versions & 2 rubygems