Skip to content

Commit

Permalink
refactor: ensure metadata entry type is not primitive nor void
Browse files Browse the repository at this point in the history
  • Loading branch information
derklaro committed Jan 28, 2025
1 parent 19c301f commit 7aa37b8
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ final class DefaultEntityMetadataFactoryBuilder<I, O> implements EntityMetadataF

@Override
public @NotNull EntityMetadataFactory.Builder<I, O> type(@NotNull Type type) {
if (type instanceof Class<?> && (((Class<?>) type).isPrimitive() || type == Void.class)) {
throw new IllegalArgumentException("Entity metadata type must not be a primitive or void");
}

this.type = Objects.requireNonNull(type, "type");
return this;
}
Expand Down

0 comments on commit 7aa37b8

Please sign in to comment.