×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Neville Kemble
Added: Jun 21, 2022 5:30 PM
Views: 9
Tags: no tags
  1. private boolean conditionResultOfDoubleOperands(Double left, Double right, PropertyFilter.Operation operation) {
  2.    if (isNull(left) && isNull(right)) {
  3.        return EQUAL.equals(operation);
  4.    } else if (isNull(left) || isNull(right)) {
  5.        return NOT_EQUAL.equals(operation);
  6.    }
  7.    switch (operation) {
  8.        case EQUAL:
  9.            return areEqual(left, right);
  10.        case NOT_EQUAL:
  11.            return areNotEqual(left, right);
  12.        case GREATER:
  13.            return left > right;
  14.        case GREATER_OR_EQUAL:
  15.            return left >= right;
  16.        case LESS:
  17.            return left < right;
  18.        case LESS_OR_EQUAL:
  19.            return left <= right;
  20.    }
  21.    return false;
  22. }