I know how to create a reference to a method that has a String
parameter and returns an int
, it\'s:
Function
If you have lombok, you can annotate your method with @SneakyThrows
SneakyThrow does not silently swallow, wrap into RuntimeException, or otherwise modify any exceptions of the listed checked exception types. The JVM does not check for the consistency of the checked exception system; javac does, and this annotation lets you opt out of its mechanism.
https://projectlombok.org/features/SneakyThrows