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

torand / FasterSQL / 13411942092

19 Feb 2025 11:56AM UTC coverage: 61.269% (-0.7%) from 61.922%
13411942092

push

github

torand
chore: prepare release

161 of 346 branches covered (46.53%)

Branch coverage included in aggregate %.

872 of 1340 relevant lines covered (65.07%)

3.43 hits per line

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

71.43
/src/main/java/io/github/torand/fastersql/statement/Helpers.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.statement;
17

18
import java.util.Collection;
19
import java.util.Objects;
20
import java.util.Optional;
21
import java.util.function.Supplier;
22
import java.util.stream.Stream;
23

24
import static java.util.stream.Collectors.joining;
25
import static io.github.torand.fastersql.util.collection.CollectionHelper.streamSafely;
26

27
public final class Helpers {
28
    private Helpers() {}
29

30
    public static String paramMarkers(long count) {
31
        return Stream.generate(() -> "?").limit(count).collect(joining(", "));
11✔
32
    }
33

34
    public static Object unwrapOptional(Object obj) {
35
        if (obj instanceof Optional<?> opt) {
3!
36
            return opt.orElse(null);
×
37
        } else {
38
            return obj;
2✔
39
        }
40
    }
41

42
    @SafeVarargs
43
    public static <T> Collection<T> unwrapSuppliers(Supplier<T>... suppliers) {
44
        return streamSafely(suppliers).map(Supplier::get).filter(Objects::nonNull).toList();
8✔
45
    }
46
}
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