diff --git a/cloud-core/src/main/java/org/incendo/cloud/parser/aggregate/AggregateParserPairBuilder.java b/cloud-core/src/main/java/org/incendo/cloud/parser/aggregate/AggregateParserPairBuilder.java index bc5d0b8e8..5e809debe 100644 --- a/cloud-core/src/main/java/org/incendo/cloud/parser/aggregate/AggregateParserPairBuilder.java +++ b/cloud-core/src/main/java/org/incendo/cloud/parser/aggregate/AggregateParserPairBuilder.java @@ -32,6 +32,8 @@ import org.incendo.cloud.parser.ArgumentParseResult; import org.incendo.cloud.type.tuple.Pair; +import static java.util.Objects.requireNonNull; + public final class AggregateParserPairBuilder { /** @@ -127,8 +129,9 @@ public AggregateParser build() { * @param output type * @return mapper */ - static Mapper directMapper(final Mapper.DirectSuccessMapper mapper) { - return mapper; + public static @NonNull Mapper directMapper( + final Mapper.@NonNull DirectSuccessMapper mapper) { + return requireNonNull(mapper, "mapper"); } public interface Mapper { diff --git a/cloud-core/src/main/java/org/incendo/cloud/parser/aggregate/AggregateParserTripletBuilder.java b/cloud-core/src/main/java/org/incendo/cloud/parser/aggregate/AggregateParserTripletBuilder.java index 6ed47b06d..8e8969988 100644 --- a/cloud-core/src/main/java/org/incendo/cloud/parser/aggregate/AggregateParserTripletBuilder.java +++ b/cloud-core/src/main/java/org/incendo/cloud/parser/aggregate/AggregateParserTripletBuilder.java @@ -32,6 +32,8 @@ import org.incendo.cloud.parser.ArgumentParseResult; import org.incendo.cloud.type.tuple.Triplet; +import static java.util.Objects.requireNonNull; + public final class AggregateParserTripletBuilder { /** @@ -134,8 +136,9 @@ public AggregateParser build() { * @param output type * @return mapper */ - static Mapper directMapper(final Mapper.DirectSuccessMapper mapper) { - return mapper; + public static @NonNull Mapper directMapper( + final Mapper.@NonNull DirectSuccessMapper mapper) { + return requireNonNull(mapper, "mapper"); } public interface Mapper {