• 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

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

18
import io.github.torand.fastersql.model.Column;
19
import io.github.torand.fastersql.sql.Context;
20

21
import java.util.stream.Stream;
22

23
import static io.github.torand.fastersql.util.contract.Requires.requireNonBlank;
24

25
/**
26
 * Represents an alias (label) for a table
27
 */
28
public class TableAlias implements Alias {
29
    private final String name;
30

31
    /**
32
     * Creates a table alias.
33
     * @param name the alias name.
34
     */
35
    public TableAlias(String name) {
2✔
36
        this.name = requireNonBlank(name, "No name specified");
7✔
37
    }
1✔
38

39
    @Override
40
    public String name() {
41
        return name;
3✔
42
    }
43

44
    // Sql
45

46
    @Override
47
    public String sql(Context context) {
48
        return name.contains(" ") ? "\"" + name + "\"" : name;
8!
49
    }
50

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

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

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