4 ms·
There are interoperable since Java 8, using the operator :: com.google.common.base.Predicate<String> guavaPredicate = ... java.util.function.Predicate<Stri
by _old_dude_ 5y ago
There are interoperable since Java 8, using the operator ::
com.google.common.base.Predicate<String> guavaPredicate = ...
java.util.function.Predicate<String> predicate = guavaPredicate::apply;
- Twisol 5y agoThe :: syntax minimizes the pain, but the fact you have to do it at all is still irritating, and IIUC it incurs a small runtime cost due to the intermediate object that's generated to convert between the two interfaces. I recently cleared out some of these intermediaries in a hot area of code and got a small but significant performance boost.