Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constructor utils #109

Closed
ljacqu opened this issue Nov 14, 2023 · 0 comments
Closed

Constructor utils #109

ljacqu opened this issue Nov 14, 2023 · 0 comments
Milestone

Comments

@ljacqu
Copy link
Owner

ljacqu commented Nov 14, 2023

I need this:

    static @NotNull Optional<Constructor<?>> getConstructor(@NotNull Class<?> declarer,
                                                            Class<?> @NotNull ... parameters) {
        try {
            return Optional.of(declarer.getDeclaredConstructor(parameters));
        } catch (NoSuchMethodException ignore) {
            return Optional.empty();
        }
    }
@ljacqu ljacqu added this to the 0.2.0 milestone Nov 14, 2023
ljacqu added a commit that referenced this issue Apr 29, 2024
@ljacqu ljacqu closed this as completed Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant