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

torand / FasterSQL / 13459599702

21 Feb 2025 03:09PM UTC coverage: 66.563% (+2.5%) from 64.062%
13459599702

push

github

torand
feat: add support for modulo operator

213 of 404 branches covered (52.72%)

Branch coverage included in aggregate %.

26 of 35 new or added lines in 10 files covered. (74.29%)

1067 of 1519 relevant lines covered (70.24%)

3.73 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/expression/Expression.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.expression;
17

18
import io.github.torand.fastersql.Field;
19
import io.github.torand.fastersql.expression.arithmetic.ArithmeticExpressions;
20
import io.github.torand.fastersql.projection.Projection;
21

22
import java.util.stream.Stream;
23

24
import static io.github.torand.fastersql.constant.Constants.$;
25

26
/**
27
 * Represents an expression resulting in a scalar value or a table with rows and columns.
28
 */
29
public interface Expression extends Projection {
30

31
    Stream<Field> fieldRefs();
32

33
    default Expression plus(Object value) {
34
        return ArithmeticExpressions.add(this, $(value));
5✔
35
    }
36

37
    default Expression plus(Expression expression) {
38
        return ArithmeticExpressions.add(this, expression);
×
39
    }
40

41
    default Expression minus(Object value) {
42
        return ArithmeticExpressions.subtract(this, $(value));
5✔
43
    }
44

45
    default Expression minus(Expression expression) {
46
        return ArithmeticExpressions.subtract(this, expression);
×
47
    }
48

49
    default Expression times(Object value) {
50
        return ArithmeticExpressions.multiply(this, $(value));
5✔
51
    }
52

53
    default Expression times(Expression expression) {
54
        return ArithmeticExpressions.multiply(this, expression);
4✔
55
    }
56

57
    default Expression dividedBy(Object value) {
58
        return ArithmeticExpressions.divide(this, $(value));
5✔
59
    }
60

61
    default Expression dividedBy(Expression expression) {
62
        return ArithmeticExpressions.divide(this, expression);
×
63
    }
64

65
    default Expression mod(Object value) {
66
        return ArithmeticExpressions.mod(this, $(value));
5✔
67
    }
68

69
    default Expression mod(Expression expression) {
NEW
70
        return ArithmeticExpressions.mod(this, expression);
×
71
    }
72
}
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