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

torand / FasterSQL / 16529523406

25 Jul 2025 06:59PM UTC coverage: 72.977% (+0.04%) from 72.942%
16529523406

push

github

torand
feat: add support for the 'between' and 'ne' comparison operators

234 of 378 branches covered (61.9%)

Branch coverage included in aggregate %.

23 of 37 new or added lines in 5 files covered. (62.16%)

1308 of 1735 relevant lines covered (75.39%)

3.99 hits per line

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

75.0
/src/main/java/io/github/torand/fastersql/predicate/comparison/Eq.java
1
/*
2
 * Copyright (c) 2024-2025 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.predicate.comparison;
17

18
import io.github.torand.fastersql.alias.ColumnAlias;
19
import io.github.torand.fastersql.expression.Expression;
20
import io.github.torand.fastersql.model.Column;
21
import io.github.torand.fastersql.predicate.LeftOperand;
22
import io.github.torand.fastersql.predicate.Predicate;
23
import io.github.torand.fastersql.sql.Context;
24

25
import java.util.stream.Stream;
26

27
import static io.github.torand.fastersql.sql.Clause.RESTRICTION;
28
import static java.util.Objects.requireNonNull;
29

30
/**
31
 * Implements the non-equivalence predicate.
32
 */
33
public class Ne implements Predicate {
34
    private final LeftOperand left;
35
    private final Expression right;
36

37
    Ne(LeftOperand left, Expression right) {
2✔
38
        this.left = requireNonNull(left, "No left operand specified");
6✔
39
        this.right = requireNonNull(right, "No right operand specified");
6✔
40
    }
1✔
41

42
    // Sql
43

44
    @Override
45
    public String sql(Context context) {
46
        Context localContext = context.withClause(RESTRICTION);
4✔
47
        return left.sql(localContext) + " <> " + right.sql(localContext);
10✔
48
    }
49

50
    @Override
51
    public Stream<Object> params(Context context) {
52
        Context localContext = context.withClause(RESTRICTION);
4✔
53
        return Stream.concat(left.params(localContext), right.params(localContext));
10✔
54
    }
55

56
    @Override
57
    public Stream<Column> columnRefs() {
58
        return Stream.concat(left.columnRefs(), right.columnRefs());
8✔
59
    }
60

61
    @Override
62
    public Stream<ColumnAlias> aliasRefs() {
NEW
63
        return Stream.concat(left.aliasRefs(), right.aliasRefs());
×
64
    }
65

66
    // Predicate
67

68
    @Override
69
    public String negatedSql(Context context) {
NEW
70
        Context localContext = context.withClause(RESTRICTION);
×
NEW
71
        return left.sql(localContext) + " = " + right.sql(localContext);
×
72
    }
73
}
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