• 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

80.0
/src/main/java/io/github/torand/fastersql/projection/ColumnPosition.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.projection;
17

18
import io.github.torand.fastersql.alias.ColumnAlias;
19
import io.github.torand.fastersql.model.Column;
20
import io.github.torand.fastersql.order.OrderExpression;
21
import io.github.torand.fastersql.sql.Context;
22
import io.github.torand.fastersql.sql.Sql;
23

24
import java.util.stream.Stream;
25

26
import static io.github.torand.fastersql.util.contract.Requires.require;
27

28
/**
29
 * Represents an enumeration of a projection, that is, a 1-based number referencing a single projection element in a SELECT clause.
30
 */
31
public class ColumnPosition implements Sql, OrderExpression {
32
    private final int position;
33

34
    /**
35
     * Creates a column position.
36
     * @param position the 1-based position.
37
     */
38
    public ColumnPosition(int position) {
2✔
39
        require(() -> position >= 1, "Position must be 1 or greater");
12!
40
        this.position = position;
3✔
41
    }
1✔
42

43
    // Sql
44

45
    @Override
46
    public String sql(Context context) {
47
        return Integer.toString(position);
4✔
48
    }
49

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

55
    @Override
56
    public Stream<Column> columnRefs() {
57
        return Stream.empty();
2✔
58
    }
59

60
    @Override
61
    public Stream<ColumnAlias> aliasRefs() {
62
        return Stream.empty();
2✔
63
    }
64
}
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