• 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

16.67
/src/main/java/io/github/torand/fastersql/condition/Condition.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;
17

18
import io.github.torand.fastersql.Context;
19
import io.github.torand.fastersql.Field;
20
import io.github.torand.fastersql.Sql;
21
import io.github.torand.fastersql.condition.logical.LogicalConditions;
22

23
import java.util.stream.Stream;
24

25
/**
26
 * Represents a restriction on the rows fetched by a query or affected by an update or delete.
27
 */
28
public interface Condition extends Sql {
29
    String negatedSql(Context context);
30

31
    Stream<Field> fields();
32

33
    Stream<Object> params(Context context);
34

35
    default Condition or(Condition other) {
36
        return LogicalConditions.or(this, other);
12✔
37
    }
38

39
    default OptionalCondition or(OptionalCondition maybeOther) {
40
        if (maybeOther.isPresent()) {
×
NEW
41
            return OptionalCondition.of(LogicalConditions.or(this, maybeOther.get()));
×
42
        } else {
NEW
43
            return OptionalCondition.of(this);
×
44
        }
45
    }
46

47
    default Condition and(Condition other) {
48
        return LogicalConditions.and(this, other);
12✔
49
    }
50

51
    default OptionalCondition and(OptionalCondition maybeOther) {
52
        if (maybeOther.isPresent()) {
×
NEW
53
            return OptionalCondition.of(LogicalConditions.and(this, maybeOther.get()));
×
54
        } else {
NEW
55
            return OptionalCondition.of(this);
×
56
        }
57
    }
58
}
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