Skip to content

Commit

Permalink
Minor: Add some nullability annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacqu committed Aug 31, 2023
1 parent b3008bd commit 499a7c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ public void putNode(@NotNull String name, @NotNull Node node) {
return mappingNode;
}

protected Node createRootNode(List<NodeTuple> entryNodes) {
protected @NotNull Node createRootNode(@NotNull List<NodeTuple> entryNodes) {
return new MappingNode(Tag.MAP, entryNodes, DumperOptions.FlowStyle.BLOCK);
}

protected final List<String> getComments() {
protected final @NotNull List<String> getComments() {
return comments;
}

protected final Map<String, Object> getValues() {
protected final @NotNull Map<String, Object> getValues() {
return values;
}
}
5 changes: 4 additions & 1 deletion src/main/java/ch/jalu/configme/utils/StreamUtils.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package ch.jalu.configme.utils;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.stream.IntStream;
import java.util.stream.Stream;

Expand All @@ -19,7 +22,7 @@ private StreamUtils() {
* @param <T> element type
* @return stream with the element the requested number of times
*/
public static <T> Stream<T> repeat(T element, int numberOfTimes) {
public static <T> @NotNull Stream<T> repeat(@Nullable T element, int numberOfTimes) {
return IntStream.range(0, numberOfTimes)
.mapToObj(i -> element);
}
Expand Down

0 comments on commit 499a7c8

Please sign in to comment.