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

torand / FasterSQL / 15346133148

30 May 2025 11:50AM UTC coverage: 70.397% (+0.1%) from 70.298%
15346133148

push

github

torand
chore: test javadoc publish

235 of 420 branches covered (55.95%)

Branch coverage included in aggregate %.

1237 of 1671 relevant lines covered (74.03%)

3.9 hits per line

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

40.0
/src/main/java/io/github/torand/fastersql/order/OrderExpression.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.order;
17

18
import io.github.torand.fastersql.sql.Sql;
19

20
/**
21
 * Defines an expression specifying the ordering of rows from a query.
22
 */
23
public interface OrderExpression extends Sql {
24

25
    /**
26
     * Creates an ascending ordering of this expression.
27
     * @return the order clause.
28
     */
29
    default Order asc() {
30
        return Orders.asc(this);
3✔
31
    }
32

33
    /**
34
     * Creates a descending ordering of this expression.
35
     * @return the order clause.
36
     */
37
    default Order desc() {
38
        return Orders.desc(this);
3✔
39
    }
40

41
    /**
42
     * Creates an ordering of this expression, based on a condition.
43
     * If condition is true, an ascending ordering is created.
44
     * If condition is false, a descending ordering is created.
45
     * @param condition the condition.
46
     * @return the order clause.
47
     */
48
    default Order ascIf(boolean condition) {
49
        return condition ? asc() : desc();
×
50
    }
51
}
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