@Test void rowMapper() { CaseExpression<String> sut = new CaseExpression<>(condition, expression1); when(expression1.rowMapper(scope, Optional.of("test_case"))).thenReturn(rowMapper); RowMapper<String> result = sut.rowMapper(scope, Optional.of("test_case")); assertThat(result, sameInstance(rowMapper)); verifyNoMoreInteractions(condition, expression1, scope); }
@Override public RowMapper<T> rowMapper(Scope scope, Optional<String> label) { return cases.get(0).item2().rowMapper(scope, Optional.of(label.orElseGet(() -> label(scope)))); }
CaseExpression implements TypedExpression<T> { @Override public RowMapper<T> rowMapper(Scope scope, Optional<String> label) { return cases.get(0).item2().rowMapper(scope, Optional.of(label.orElseGet(() -> label(scope)))); } }
CaseExpression implements TypedExpression<T> { @Override public RowMapper<T> rowMapper(Scope scope, Optional<String> label) { return cases.get(0).item2().rowMapper(scope, Optional.of(label.orElseGet(() -> label(scope)))); } CaseExpression(BooleanExpression booleanExpression, TypedExpression<T> value); }
CaseExpression implements TypedExpression<T> { @Override public RowMapper<T> rowMapper(Scope scope, Optional<String> label) { return cases.get(0).item2().rowMapper(scope, Optional.of(label.orElseGet(() -> label(scope)))); } CaseExpression(BooleanExpression booleanExpression, TypedExpression<T> value); @Override String sql(Scope scope); @Override Stream<Object> args(Scope scope); @Override Precedence precedence(); @Override String label(Scope scope); @Override RowMapper<T> rowMapper(Scope scope, Optional<String> label); @Override TypeToken<T> type(); TypedExpression<T> orElse(T value); TypedExpression<T> orElse(TypedExpression<T> value); TypedExpression<T> orElse(Function1<R,T> method); TypedExpression<T> orElse(FunctionOptional1<R,T> method); TypedExpression<T> orElse(String alias, Function1<R,T> method); TypedExpression<T> orElse(String alias, FunctionOptional1<R,T> method); TypedExpression<T> orElse(Alias<R> alias, Function1<R,T> method); TypedExpression<T> orElse(Alias<R> alias, FunctionOptional1<R,T> method); ExpressionBuilder<X,InSubsequentWhenExpectingThen> when(X val); ExpressionBuilder<X,InSubsequentWhenExpectingThen> when(TypedExpression<X> expression); ExpressionBuilder<R,InSubsequentWhenExpectingThen> when(Function1<X,R> method); ExpressionBuilder<R,InSubsequentWhenExpectingThen> when(FunctionOptional1<X,R> method); ExpressionBuilder<R,InSubsequentWhenExpectingThen> when(String alias, Function1<X,R> method); ExpressionBuilder<R,InSubsequentWhenExpectingThen> when(String alias, FunctionOptional1<X,R> method); ExpressionBuilder<R,InSubsequentWhenExpectingThen> when(Alias<X> alias, Function1<X,R> method); ExpressionBuilder<R,InSubsequentWhenExpectingThen> when(Alias<X> alias, FunctionOptional1<X,R> method); }
CaseExpression implements TypedExpression<T> { @Override public RowMapper<T> rowMapper(Scope scope, Optional<String> label) { return cases.get(0).item2().rowMapper(scope, Optional.of(label.orElseGet(() -> label(scope)))); } CaseExpression(BooleanExpression booleanExpression, TypedExpression<T> value); @Override String sql(Scope scope); @Override Stream<Object> args(Scope scope); @Override Precedence precedence(); @Override String label(Scope scope); @Override RowMapper<T> rowMapper(Scope scope, Optional<String> label); @Override TypeToken<T> type(); TypedExpression<T> orElse(T value); TypedExpression<T> orElse(TypedExpression<T> value); TypedExpression<T> orElse(Function1<R,T> method); TypedExpression<T> orElse(FunctionOptional1<R,T> method); TypedExpression<T> orElse(String alias, Function1<R,T> method); TypedExpression<T> orElse(String alias, FunctionOptional1<R,T> method); TypedExpression<T> orElse(Alias<R> alias, Function1<R,T> method); TypedExpression<T> orElse(Alias<R> alias, FunctionOptional1<R,T> method); ExpressionBuilder<X,InSubsequentWhenExpectingThen> when(X val); ExpressionBuilder<X,InSubsequentWhenExpectingThen> when(TypedExpression<X> expression); ExpressionBuilder<R,InSubsequentWhenExpectingThen> when(Function1<X,R> method); ExpressionBuilder<R,InSubsequentWhenExpectingThen> when(FunctionOptional1<X,R> method); ExpressionBuilder<R,InSubsequentWhenExpectingThen> when(String alias, Function1<X,R> method); ExpressionBuilder<R,InSubsequentWhenExpectingThen> when(String alias, FunctionOptional1<X,R> method); ExpressionBuilder<R,InSubsequentWhenExpectingThen> when(Alias<X> alias, Function1<X,R> method); ExpressionBuilder<R,InSubsequentWhenExpectingThen> when(Alias<X> alias, FunctionOptional1<X,R> method);  }