test_class.declarator: generator = new ConditionValueInOperatorGenerator()
test_class.modifier: private final
test_class.original_string: private final ConditionValueInOperatorGenerator generator = new ConditionValueInOperatorGenerator();
test_class.type: ConditionValueInOperatorGenerator
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/ConditionValueInOperatorGeneratorTest.java
test_class.identifier: ConditionValueInOperatorGeneratorTest
test_case.body: @Test
      public void assertNowExpression() {
          ListExpression listExpression = new ListExpression(0, 0);
          listExpression.getItems().add(new CommonExpressionSegment(0, 0, "now()"));
          InExpression inExpression = new InExpression(0, 0, null, listExpression, false);
          Optional<RouteValue> routeValue = generator.generate(inExpression, column, new LinkedList<>());
          assertTrue(routeValue.isPresent());
          assertThat(((ListRouteValue) routeValue.get()).getValues().iterator().next(), instanceOf(Date.class));
      }
test_case.class_method_signature: ConditionValueInOperatorGeneratorTest.assertNowExpression()
test_case.full_signature: @Test public void assertNowExpression()
test_case.identifier: assertNowExpression
test_case.invocations: add getItems generate assertTrue isPresent assertThat next iterator getValues get instanceOf
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertNowExpression()
focal_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/generator/impl/ConditionValueInOperatorGenerator.java
focal_class.identifier: ConditionValueInOperatorGenerator
focal_class.interfaces: implements ConditionValueGenerator<InExpression>
focal_class.class_method_signature: ConditionValueInOperatorGenerator.generate(final InExpression predicate, final Column column, final List<Object> parameters)
focal_class.full_signature: @Override public Optional<RouteValue> generate(final InExpression predicate, final Column column, final List<Object> parameters)
focal_class.identifier: generate
focal_class.modifiers: @Override public
focal_class.parameters: (final InExpression predicate, final Column column, final List<Object> parameters)
focal_class.return: Optional<RouteValue>
focal_class.signature: Optional<RouteValue> generate(final InExpression predicate, final Column column, final List<Object> parameters)
focal_method.body: @Override
      public Optional<RouteValue> generate(final InExpression predicate, final Column column, final List<Object> parameters) {
          List<Comparable<?>> routeValues = new LinkedList<>();
          SPITimeService timeService = new SPITimeService();
          for (ExpressionSegment each : predicate.getExpressionList()) {
              Optional<Comparable<?>> routeValue = new ConditionValue(each, parameters).getValue();
              if (routeValue.isPresent()) {
                  routeValues.add(routeValue.get());
                  continue;
              }
              if (ExpressionConditionUtils.isNowExpression(each)) {
                  routeValues.add(timeService.getTime());
              }
          }
          return routeValues.isEmpty() ? Optional.empty() : Optional.of(new ListRouteValue<>(column.getName(), column.getTableName(), routeValues));
      }
focal_method.class_method_signature: ConditionValueInOperatorGenerator.generate(final InExpression predicate, final Column column, final List<Object> parameters)
focal_method.full_signature: @Override public Optional<RouteValue> generate(final InExpression predicate, final Column column, final List<Object> parameters)
focal_method.identifier: generate
focal_method.invocations: getExpressionList getValue isPresent add get isNowExpression add getTime isEmpty empty of getName getTableName
focal_method.modifiers: @Override public
focal_method.parameters: (final InExpression predicate, final Column column, final List<Object> parameters)
focal_method.return: Optional<RouteValue>
focal_method.signature: Optional<RouteValue> generate(final InExpression predicate, final Column column, final List<Object> parameters)