• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

torand / FasterSQL / 12893661530

21 Jan 2025 06:40PM UTC coverage: 50.829%. Remained the same
12893661530

push

github

torand
refactor: rename expression -> condition

104 of 304 branches covered (34.21%)

Branch coverage included in aggregate %.

81 of 211 new or added lines in 24 files covered. (38.39%)

3 existing lines in 2 files now uncovered.

601 of 1083 relevant lines covered (55.49%)

2.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/src/main/java/io/github/torand/fastersql/condition/comparison/In.java
1
/*
2
 * Copyright (c) 2024 Tore Eide Andersen
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package io.github.torand.fastersql.condition.comparison;
17

18
import io.github.torand.fastersql.Context;
19
import io.github.torand.fastersql.Field;
20
import io.github.torand.fastersql.condition.Condition;
21
import io.github.torand.fastersql.condition.LeftOperand;
22

23
import java.util.Collection;
24
import java.util.List;
25
import java.util.stream.Stream;
26

27
import static io.github.torand.fastersql.statement.Helpers.paramMarkers;
28
import static io.github.torand.fastersql.util.collection.CollectionHelper.asList;
29
import static io.github.torand.fastersql.util.contract.Requires.requireNonEmpty;
30
import static java.util.Objects.requireNonNull;
31

32
public class In implements Condition {
33
    private final LeftOperand left;
34
    private final List<?> right;
35

36
    In(LeftOperand left, Collection<?> right) {
2✔
37
        this.left = requireNonNull(left, "No left operand specified");
6✔
38
        this.right = asList(requireNonEmpty(right, "No right operand specified"));
8✔
39
    }
1✔
40

41
    @Override
42
    public String sql(Context context) {
43
        return left.sql(context) + " in (" + paramMarkers(right.size()) + ")";
11✔
44
    }
45

46
    @Override
47
    public String negatedSql(Context context) {
NEW
48
        return left.sql(context) + " not in (" + paramMarkers(right.size()) + ")";
×
49
    }
50

51
    @Override
52
    public Stream<Object> params(Context context) {
53
        return right.stream().map(v -> v);
8✔
54
    }
55

56
    @Override
57
    public Stream<Field> fields() {
58
        return left.fields();
4✔
59
    }
60
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc