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

torand / FasterSQL / 13316818541

13 Feb 2025 08:49PM UTC coverage: 56.762%. First build
13316818541

Pull #8

github

web-flow
Merge a7d313d14 into 1f252c094
Pull Request #8: feat: misc additions

143 of 336 branches covered (42.56%)

Branch coverage included in aggregate %.

97 of 171 new or added lines in 34 files covered. (56.73%)

772 of 1276 relevant lines covered (60.5%)

3.21 hits per line

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

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

18
import io.github.torand.fastersql.Context;
19
import io.github.torand.fastersql.Field;
20
import io.github.torand.fastersql.projection.Projection;
21

22
import java.util.stream.Stream;
23

24
import static io.github.torand.fastersql.util.contract.Requires.requireNonBlank;
25
import static java.util.Objects.requireNonNull;
26

27
public class Descending implements Order {
28
    private final Projection projection;
29
    private final String alias;
30

31
    Descending(Projection projection) {
2✔
32
        this.projection = requireNonNull(projection, "No projection specified");
6✔
33
        this.alias = projection.alias();
4✔
34
    }
1✔
35

NEW
36
    Descending(String alias) {
×
NEW
37
        this.projection = null;
×
NEW
38
        this.alias = requireNonBlank(alias, "No alias specified");
×
39
    }
×
40

41
    // Sql
42

43
    @Override
44
    public String sql(Context context) {
45
        return alias + " desc";
4✔
46
    }
47

48
    @Override
49
    public Stream<Object> params(Context context) {
50
        return Stream.empty();
×
51
    }
52

53
    // Order
54

55
    @Override
56
    public Stream<Field> fieldRefs() {
57
        return projection instanceof Field ? Stream.of((Field)projection) : Stream.empty();
10!
58
    }
59
}
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