Monday, August 29, 2016

jsinterop export method that returns Optional

I'm trying to export a Java method with @JsMethod which returns an Optional. 

Clearly GWT is emulating Optional under the hood for internal code. Is it possible to export the Optional class as well?

At the moment it compiles, but gives me a warning:
[unusable-by-js] Return type of 'Optional MyClass.myMethod(String)' is not usable by but exposed to JavaScript.

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment