From 17d81cb0c97cc814c5391b659d8b91bd90fd34c5 Mon Sep 17 00:00:00 2001 From: Miroslav Pokorny Date: Thu, 7 Dec 2023 07:46:10 +1100 Subject: [PATCH] ExpressionFunctionParameter.checkName extracted --- .../expression/function/ExpressionFunctionParameter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/walkingkooka/tree/expression/function/ExpressionFunctionParameter.java b/src/main/java/walkingkooka/tree/expression/function/ExpressionFunctionParameter.java index 36749ee6..c8578121 100644 --- a/src/main/java/walkingkooka/tree/expression/function/ExpressionFunctionParameter.java +++ b/src/main/java/walkingkooka/tree/expression/function/ExpressionFunctionParameter.java @@ -87,7 +87,7 @@ public static ExpressionFunctionParameter with(final ExpressionFunctionPa final List> typeParameters, final ExpressionFunctionParameterCardinality cardinality, final Set kinds) { - Objects.requireNonNull(name, "name"); + checkName(name); checkType(type); Objects.requireNonNull(typeParameters, "typeParameters"); Objects.requireNonNull(cardinality, "cardinality"); @@ -102,6 +102,10 @@ public static ExpressionFunctionParameter with(final ExpressionFunctionPa ); } + private static ExpressionFunctionParameterName checkName(final ExpressionFunctionParameterName name) { + return Objects.requireNonNull(name, "name"); + } + private static Class checkType(final Class type) { return Objects.requireNonNull(type, "type"); } @@ -127,7 +131,7 @@ public ExpressionFunctionParameterName name() { * Would be setter that returns a {@link ExpressionFunctionParameter} with the given {@link ExpressionFunctionParameterName}. */ public ExpressionFunctionParameter setName(final ExpressionFunctionParameterName name) { - Objects.requireNonNull(name, "name"); + checkName(name); return this.name.equals(name) ? this :