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

torand / FasterSQL / 12969157631

25 Jan 2025 11:02PM UTC coverage: 49.458% (-1.4%) from 50.829%
12969157631

push

github

torand
feat: introduced the concept of expressions

108 of 322 branches covered (33.54%)

Branch coverage included in aggregate %.

97 of 271 new or added lines in 43 files covered. (35.79%)

622 of 1154 relevant lines covered (53.9%)

2.85 hits per line

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

0.0
/src/main/java/io/github/torand/fastersql/condition/comparison/Gt.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
import io.github.torand.fastersql.expression.Expression;
23

24
import java.util.stream.Stream;
25

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

29
public class Gt implements Condition {
30
    private final LeftOperand left;
31
    private final Expression right;
32

NEW
33
    Gt(LeftOperand left, Expression right) {
×
34
        this.left = requireNonNull(left, "No left operand specified");
×
35
        this.right = requireNonNull(right, "No right operand specified");
×
36
    }
×
37

38
    // Sql
39

40
    @Override
41
    public String sql(Context context) {
NEW
42
        Context localContext = context.withClause(RESTRICTION);
×
NEW
43
        return left.sql(localContext) + " > " + right.sql(localContext);
×
44
    }
45

46
    @Override
47
    public Stream<Object> params(Context context) {
NEW
48
        Context localContext = context.withClause(RESTRICTION);
×
NEW
49
        return Stream.concat(left.params(localContext), right.params(localContext));
×
50
    }
51

52
    // Condition
53

54
    @Override
55
    public String negatedSql(Context context) {
NEW
56
        Context localContext = context.withClause(RESTRICTION);
×
NEW
57
        return left.sql(localContext) + " <= " + right.sql(localContext);
×
58
    }
59

60
    @Override
61
    public Stream<Field> fieldRefs() {
NEW
62
        return Stream.concat(left.fieldRefs(), right.fieldRefs());
×
63
    }
64
}
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