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

AuthMe / ConfigMe / 6161407230

12 Sep 2023 03:11PM UTC coverage: 98.153% (-0.4%) from 98.541%
6161407230

push

github

ljacqu
Add missing javadoc + constructors, nullability annotations, some tests...

534 of 548 branches covered (0.0%)

16 of 16 new or added lines in 6 files covered. (100.0%)

1488 of 1516 relevant lines covered (98.15%)

4.49 hits per line

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

71.43
/src/main/java/ch/jalu/configme/properties/SetProperty.java
1
package ch.jalu.configme.properties;
2

3
import ch.jalu.configme.properties.types.PropertyType;
4
import ch.jalu.configme.properties.types.SetPropertyType;
5
import org.jetbrains.annotations.NotNull;
6

7
import java.util.Arrays;
8
import java.util.Collections;
9
import java.util.LinkedHashSet;
10
import java.util.Set;
11
import java.util.stream.Collectors;
12

13
/**
14
 * Set property of configurable type. The sets are immutable and preserve the order.  TODO "immutable" comment not really true
15
 *
16
 * @param <E> the set type
17
 */
18
public class SetProperty<E> extends TypeBasedProperty<Set<E>> {
19

20
    /**
21
     * Constructor.
22
     *
23
     * @param path the path of the property
24
     * @param entryType the entry type
25
     * @param defaultValue the values that make up the entries of the default set
26
     */
27
    @SafeVarargs
28
    public SetProperty(@NotNull String path, @NotNull PropertyType<E> entryType, @NotNull E @NotNull ... defaultValue) {
29
        this(path, entryType, newSet(defaultValue));
6✔
30
    }
1✔
31

32
    /**
33
     * Constructor.
34
     *
35
     * @param path the path of the property
36
     * @param entryType the entry type
37
     * @param defaultValue the default value of the property
38
     */
39
    public SetProperty(@NotNull String path, @NotNull PropertyType<E> entryType, @NotNull Set<E> defaultValue) {
40
        super(path, Collections.unmodifiableSet(defaultValue), new SetPropertyType<>(entryType));
9✔
41
    }
1✔
42

43
    /**
44
     * Constructor.
45
     *
46
     * @param path the path of the property
47
     * @param type the type of the set
48
     * @param defaultValue the default value of the property
49
     */
50
    public SetProperty(@NotNull String path, @NotNull SetPropertyType<E> type, @NotNull Set<E> defaultValue) {
51
        super(path, Collections.unmodifiableSet(defaultValue), type);
×
52
    }
×
53

54
    private static <E> @NotNull Set<E> newSet(E @NotNull [] array) {
55
        return Arrays.stream(array).collect(Collectors.toCollection(LinkedHashSet::new));
7✔
56
    }
57
}
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