Skip to content

Commit

Permalink
Merge pull request #699 from mP1/feature/ExpressionFunctionParameter-…
Browse files Browse the repository at this point in the history
…checkName-extracted

ExpressionFunctionParameter.checkName extracted
  • Loading branch information
mP1 authored Dec 6, 2023
2 parents 08dfb0c + 17d81cb commit 9dd83b5
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static <T> ExpressionFunctionParameter<T> with(final ExpressionFunctionPa
final List<Class<?>> typeParameters,
final ExpressionFunctionParameterCardinality cardinality,
final Set<ExpressionFunctionParameterKind> kinds) {
Objects.requireNonNull(name, "name");
checkName(name);
checkType(type);
Objects.requireNonNull(typeParameters, "typeParameters");
Objects.requireNonNull(cardinality, "cardinality");
Expand All @@ -102,6 +102,10 @@ public static <T> ExpressionFunctionParameter<T> with(final ExpressionFunctionPa
);
}

private static ExpressionFunctionParameterName checkName(final ExpressionFunctionParameterName name) {
return Objects.requireNonNull(name, "name");
}

private static <T> Class<T> checkType(final Class<T> type) {
return Objects.requireNonNull(type, "type");
}
Expand All @@ -127,7 +131,7 @@ public ExpressionFunctionParameterName name() {
* Would be setter that returns a {@link ExpressionFunctionParameter} with the given {@link ExpressionFunctionParameterName}.
*/
public ExpressionFunctionParameter<T> setName(final ExpressionFunctionParameterName name) {
Objects.requireNonNull(name, "name");
checkName(name);

return this.name.equals(name) ?
this :
Expand Down

0 comments on commit 9dd83b5

Please sign in to comment.