@Test void rowMapper() { CoalesceFunction<String> sut = coalesce(expression1).orElse(expression2); when(expression1.rowMapper(scope, Optional.of("custom_label"))).thenReturn(rowMapper); RowMapper<String> result = sut.rowMapper(scope, Optional.of("custom_label")); assertThat(result, sameInstance(rowMapper)); verify(expression1).rowMapper(scope, Optional.of("custom_label")); verifyNoMoreInteractions(expression1, expression2); }
@Override public RowMapper<T> rowMapper(Scope scope, Optional<String> label) { return terms.get(0).rowMapper(scope, Optional.of(label.orElseGet(() -> label(scope)))); }
CoalesceFunction implements TypedExpression<T> { @Override public RowMapper<T> rowMapper(Scope scope, Optional<String> label) { return terms.get(0).rowMapper(scope, Optional.of(label.orElseGet(() -> label(scope)))); } }
CoalesceFunction implements TypedExpression<T> { @Override public RowMapper<T> rowMapper(Scope scope, Optional<String> label) { return terms.get(0).rowMapper(scope, Optional.of(label.orElseGet(() -> label(scope)))); } private  CoalesceFunction(TypedExpression<T> expression); }
CoalesceFunction implements TypedExpression<T> { @Override public RowMapper<T> rowMapper(Scope scope, Optional<String> label) { return terms.get(0).rowMapper(scope, Optional.of(label.orElseGet(() -> label(scope)))); } private  CoalesceFunction(TypedExpression<T> expression); @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(); @NotNull CoalesceFunction<T> orElse(T value); @NotNull CoalesceFunction<T> orElse(TypedExpression<T> expression); @NotNull CoalesceFunction<T> orElse(Function1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(FunctionOptional1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(String alias, Function1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(String alias, FunctionOptional1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(Alias<R> alias, Function1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(Alias<R> alias, FunctionOptional1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(TypedExpression<T> expression); @NotNull static CoalesceFunction<T> coalesce(Function1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(FunctionOptional1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(String alias, Function1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(String alias, FunctionOptional1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(Alias<R> alias, Function1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(Alias<R> alias, FunctionOptional1<R,T> methodReference); }
CoalesceFunction implements TypedExpression<T> { @Override public RowMapper<T> rowMapper(Scope scope, Optional<String> label) { return terms.get(0).rowMapper(scope, Optional.of(label.orElseGet(() -> label(scope)))); } private  CoalesceFunction(TypedExpression<T> expression); @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(); @NotNull CoalesceFunction<T> orElse(T value); @NotNull CoalesceFunction<T> orElse(TypedExpression<T> expression); @NotNull CoalesceFunction<T> orElse(Function1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(FunctionOptional1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(String alias, Function1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(String alias, FunctionOptional1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(Alias<R> alias, Function1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(Alias<R> alias, FunctionOptional1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(TypedExpression<T> expression); @NotNull static CoalesceFunction<T> coalesce(Function1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(FunctionOptional1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(String alias, Function1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(String alias, FunctionOptional1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(Alias<R> alias, Function1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(Alias<R> alias, FunctionOptional1<R,T> methodReference);  }