test_class.declarator: generator = new ConditionValueCompareOperatorGenerator()
test_class.modifier: private final
test_class.original_string: private final ConditionValueCompareOperatorGenerator generator = new ConditionValueCompareOperatorGenerator();
test_class.type: ConditionValueCompareOperatorGenerator
test_class.var_name: generator
test_class.declarator: column = new Column("id", "tbl")
test_class.modifier: private final
test_class.original_string: private final Column column = new Column("id", "tbl");
test_class.type: Column
test_class.var_name: column
test_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/generator/impl/ConditionValueCompareOperatorGeneratorTest.java
test_class.identifier: ConditionValueCompareOperatorGeneratorTest
test_case.body: @SuppressWarnings("unchecked")
      @Test
      public void assertGenerateConditionValue() {
          int value = 1;
          BinaryOperationExpression rightValue = new BinaryOperationExpression(0, 0, null, new LiteralExpressionSegment(0, 0, value), "=", null);
          Optional<RouteValue> routeValue = generator.generate(rightValue, column, new LinkedList<>());
          assertTrue(routeValue.isPresent());
          assertTrue(((ListRouteValue<Integer>) routeValue.get()).getValues().contains(value));
      }
test_case.class_method_signature: ConditionValueCompareOperatorGeneratorTest.assertGenerateConditionValue()
test_case.full_signature: @SuppressWarnings("unchecked") @Test public void assertGenerateConditionValue()
test_case.identifier: assertGenerateConditionValue
test_case.invocations: generate assertTrue isPresent assertTrue contains getValues get
test_case.modifiers: @SuppressWarnings("unchecked") @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertGenerateConditionValue()
focal_class.declarator: EQUAL = "="
focal_class.modifier: private static final
focal_class.original_string: private static final String EQUAL = "=";
focal_class.type: String
focal_class.var_name: EQUAL
focal_class.declarator: GREATER_THAN = ">"
focal_class.modifier: private static final
focal_class.original_string: private static final String GREATER_THAN = ">";
focal_class.type: String
focal_class.var_name: GREATER_THAN
focal_class.declarator: LESS_THAN = "<"
focal_class.modifier: private static final
focal_class.original_string: private static final String LESS_THAN = "<";
focal_class.type: String
focal_class.var_name: LESS_THAN
focal_class.declarator: AT_MOST = "<="
focal_class.modifier: private static final
focal_class.original_string: private static final String AT_MOST = "<=";
focal_class.type: String
focal_class.var_name: AT_MOST
focal_class.declarator: AT_LEAST = ">="
focal_class.modifier: private static final
focal_class.original_string: private static final String AT_LEAST = ">=";
focal_class.type: String
focal_class.var_name: AT_LEAST
focal_class.declarator: OPERATORS = Arrays.asList(EQUAL, GREATER_THAN, LESS_THAN, AT_LEAST, AT_MOST)
focal_class.modifier: private static final
focal_class.original_string: private static final List<String> OPERATORS = Arrays.asList(EQUAL, GREATER_THAN, LESS_THAN, AT_LEAST, AT_MOST);
focal_class.type: List<String>
focal_class.var_name: OPERATORS
focal_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/generator/impl/ConditionValueCompareOperatorGenerator.java
focal_class.identifier: ConditionValueCompareOperatorGenerator
focal_class.interfaces: implements ConditionValueGenerator<BinaryOperationExpression>
focal_class.class_method_signature: ConditionValueCompareOperatorGenerator.generate(final BinaryOperationExpression predicate, final Column column, final List<Object> parameters)
focal_class.full_signature: @Override public Optional<RouteValue> generate(final BinaryOperationExpression predicate, final Column column, final List<Object> parameters)
focal_class.identifier: generate
focal_class.modifiers: @Override public
focal_class.parameters: (final BinaryOperationExpression predicate, final Column column, final List<Object> parameters)
focal_class.return: Optional<RouteValue>
focal_class.signature: Optional<RouteValue> generate(final BinaryOperationExpression predicate, final Column column, final List<Object> parameters)
focal_class.class_method_signature: ConditionValueCompareOperatorGenerator.generate(final Comparable<?> comparable, final Column column, final String operator)
focal_class.full_signature: private Optional<RouteValue> generate(final Comparable<?> comparable, final Column column, final String operator)
focal_class.identifier: generate
focal_class.modifiers: private
focal_class.parameters: (final Comparable<?> comparable, final Column column, final String operator)
focal_class.return: Optional<RouteValue>
focal_class.signature: Optional<RouteValue> generate(final Comparable<?> comparable, final Column column, final String operator)
focal_class.class_method_signature: ConditionValueCompareOperatorGenerator.isSupportedOperator(final String operator)
focal_class.full_signature: private boolean isSupportedOperator(final String operator)
focal_class.identifier: isSupportedOperator
focal_class.modifiers: private
focal_class.parameters: (final String operator)
focal_class.return: boolean
focal_class.signature: boolean isSupportedOperator(final String operator)
focal_method.body: @Override
      public Optional<RouteValue> generate(final BinaryOperationExpression predicate, final Column column, final List<Object> parameters) {
          String operator = predicate.getOperator();
          if (!isSupportedOperator(operator)) {
              return Optional.empty();
          }
          Optional<Comparable<?>> routeValue = new ConditionValue(predicate.getRight(), parameters).getValue();
          if (routeValue.isPresent()) {
              return generate(routeValue.get(), column, operator);
          }
          if (ExpressionConditionUtils.isNowExpression(predicate.getRight())) {
              return generate(new SPITimeService().getTime(), column, operator);
          }
          return Optional.empty();
      }
focal_method.class_method_signature: ConditionValueCompareOperatorGenerator.generate(final BinaryOperationExpression predicate, final Column column, final List<Object> parameters)
focal_method.full_signature: @Override public Optional<RouteValue> generate(final BinaryOperationExpression predicate, final Column column, final List<Object> parameters)
focal_method.identifier: generate
focal_method.invocations: getOperator isSupportedOperator empty getValue getRight isPresent generate get isNowExpression getRight generate getTime empty
focal_method.modifiers: @Override public
focal_method.parameters: (final BinaryOperationExpression predicate, final Column column, final List<Object> parameters)
focal_method.return: Optional<RouteValue>
focal_method.signature: Optional<RouteValue> generate(final BinaryOperationExpression predicate, final Column column, final List<Object> parameters)