We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This produces an unchecked warning:
Class<T> clazz = ...; if (clazz.isInstance(obj)) { return (T) obj; }
I guess the solution would be to replace (T) obj with clazz.cast(obj) but a method returning Optional<T> would be quite elegant
(T) obj
clazz.cast(obj)
Optional<T>
The text was updated successfully, but these errors were encountered:
#100 Introduce ClassUtils#tryCast
5361053
No branches or pull requests
This produces an unchecked warning:
I guess the solution would be to replace
(T) obj
withclazz.cast(obj)
but a method returningOptional<T>
would be quite elegantThe text was updated successfully, but these errors were encountered: