java - Migrating from guava.Optional to java8.Optional -
trying migration guava optional implementation java 8 optional. got issue not able understand. here how method looks:
public optional<entity> getentity(string input) { try{ final entity obj = otherclass.verifyentity(input); return optional.of(obj); } catch(exception e) { } return optional.empty(); }
it looks straight forward keep getting compilation error says change return type optional<entity
.
what wrong code?
try using return optional.<entity>empty();
Comments
Post a Comment