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

torand / FasterSQL / 16990059345

15 Aug 2025 12:34PM UTC coverage: 66.782% (-6.6%) from 73.399%
16990059345

push

github

torand
chore: access central snapshots

294 of 598 branches covered (49.16%)

Branch coverage included in aggregate %.

1638 of 2295 relevant lines covered (71.37%)

3.83 hits per line

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

60.0
/src/main/java/io/github/torand/fastersql/predicate/Predicates.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;
17

18
import io.github.torand.fastersql.subquery.ExpressionSubquery;
19

20
import java.util.Collection;
21

22
/**
23
 * Provides factory methods for predicates.
24
 */
25
public final class Predicates {
26
    private Predicates() {
27
    }
28

29
    /**
30
     * Create a 'member of set' predicate taking a collection of scalar values as right operand.
31
     *
32
     * @param left  the left operand.
33
     * @param right the right operand (scalar value collection).
34
     * @return the predicate.
35
     */
36
    public static In in(LeftOperand left, Collection<?> right) {
37
        return new In(left, right);
6✔
38
    }
39

40
    /**
41
     * Create a 'member of set' predicate taking a subquery as right operand.
42
     *
43
     * @param left  the left operand.
44
     * @param right the right operand (subquery).
45
     * @return the predicate.
46
     */
47
    public static InSubquery in(LeftOperand left, ExpressionSubquery right) {
48
        return new InSubquery(left, right);
×
49
    }
50

51
    /**
52
     * Create an 'existence' (at least one row) predicate taking a subquery as right operand.
53
     *
54
     * @param operand the operand (subquery).
55
     * @return the predicate.
56
     */
57
    public static ExistsSubquery exists(ExpressionSubquery operand) {
58
        return new ExistsSubquery(operand);
×
59
    }
60

61
    /**
62
     * Creates a pattern matching predicate.
63
     *
64
     * @param left  the left operand.
65
     * @param right the right operand (pattern).
66
     * @return the predicate.
67
     */
68
    public static Like like(LeftOperand left, String right) {
69
        return new Like(left, right);
6✔
70
    }
71

72
    /**
73
     * Creates an 'is null' predicate.
74
     *
75
     * @param operand the operand.
76
     * @return the predicate.
77
     */
78
    public static IsNull isNull(LeftOperand operand) {
79
        return new IsNull(operand);
5✔
80
    }
81
}
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