@Test void label() { CaseExpression<String> sut1 = new CaseExpression<>(condition, expression1); CaseExpression<String> sut2 = new CaseExpression<>(condition, expression2); when(scope.newLabel()).thenReturn(1L).thenReturn(2L); String label1 = sut1.label(scope); String label2 = sut1.label(scope); String label3 = sut2.label(scope); assertThat(label1, is(label2)); assertThat(label1, not(is(label3))); assertThat(label1, startsWith("case_")); assertThat(label3, startsWith("case_")); verifyNoMoreInteractions(condition, expression1, expression2, scope); }
@Override public String label(Scope scope) { return labelGenerator.label(scope); }
CaseExpression implements TypedExpression<T> { @Override public String label(Scope scope) { return labelGenerator.label(scope); } }
CaseExpression implements TypedExpression<T> { @Override public String label(Scope scope) { return labelGenerator.label(scope); } CaseExpression(BooleanExpression booleanExpression, TypedExpression<T> value); }
CaseExpression implements TypedExpression<T> { @Override public String label(Scope scope) { return labelGenerator.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 String label(Scope scope) { return labelGenerator.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);  }