{"action":"created","issue":{"url":"https://api.github.com/repos/ralfstx/minimal-json/issues/94","repository_url":"https://api.github.com/repos/ralfstx/minimal-json","labels_url":"https://api.github.com/repos/ralfstx/minimal-json/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/ralfstx/minimal-json/issues/94/comments","events_url":"https://api.github.com/repos/ralfstx/minimal-json/issues/94/events","html_url":"https://github.com/ralfstx/minimal-json/issues/94","id":313742387,"number":94,"title":"Use of Optionals in Java 8","user":{"login":"CLOVIS-AI","id":25709889,"avatar_url":"https://avatars0.githubusercontent.com/u/25709889?v=4","gravatar_id":"","url":"https://api.github.com/users/CLOVIS-AI","html_url":"https://github.com/CLOVIS-AI","followers_url":"https://api.github.com/users/CLOVIS-AI/followers","following_url":"https://api.github.com/users/CLOVIS-AI/following{/other_user}","gists_url":"https://api.github.com/users/CLOVIS-AI/gists{/gist_id}","starred_url":"https://api.github.com/users/CLOVIS-AI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CLOVIS-AI/subscriptions","organizations_url":"https://api.github.com/users/CLOVIS-AI/orgs","repos_url":"https://api.github.com/users/CLOVIS-AI/repos","events_url":"https://api.github.com/users/CLOVIS-AI/events{/privacy}","received_events_url":"https://api.github.com/users/CLOVIS-AI/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-04-12T14:05:40Z","updated_at":"2018-04-13T09:33:02Z","closed_at":null,"author_association":"NONE","body":"Since Java 8, Optionals were added to replace `null` when a method can not return a result, as seen in `JsonObject` with the methods `get`, `getInt` ...\r\n\r\nAlthough the current use of default values is convenient, I think it would be good to allow the use of Optionals, as they allow more control.\r\n\r\nI am ready to make the changes myself and submit a pull request, but I'm not sure if it's better, regarding this project's policy, to do it:\r\n\r\n 1. replace the current methods' return type by Optionals (can cause problems with dependancies)\r\n 2. add new methods (like `getOptional`, `getIntOptional`), which can make the code a bit \"messy\" (and maybe deprecate the old ones)\r\n\r\nDo you think it's worth doing it, and if it is, which would be the best way (I mean, the most user-friendly way) of implementing it?"},"comment":{"url":"https://api.github.com/repos/ralfstx/minimal-json/issues/comments/381080932","html_url":"https://github.com/ralfstx/minimal-json/issues/94#issuecomment-381080932","issue_url":"https://api.github.com/repos/ralfstx/minimal-json/issues/94","id":381080932,"user":{"login":"sroughley","id":8321832,"avatar_url":"https://avatars0.githubusercontent.com/u/8321832?v=4","gravatar_id":"","url":"https://api.github.com/users/sroughley","html_url":"https://github.com/sroughley","followers_url":"https://api.github.com/users/sroughley/followers","following_url":"https://api.github.com/users/sroughley/following{/other_user}","gists_url":"https://api.github.com/users/sroughley/gists{/gist_id}","starred_url":"https://api.github.com/users/sroughley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sroughley/subscriptions","organizations_url":"https://api.github.com/users/sroughley/orgs","repos_url":"https://api.github.com/users/sroughley/repos","events_url":"https://api.github.com/users/sroughley/events{/privacy}","received_events_url":"https://api.github.com/users/sroughley/received_events","type":"User","site_admin":false},"created_at":"2018-04-13T09:33:02Z","updated_at":"2018-04-13T09:33:02Z","author_association":"NONE","body":"Yes, that was how I understood the suggestion -  I would assume in each case the actual method would be something very simple like\r\n\r\n    Optional<JsonValue> get(String name) {\r\n        return Optional.ofNullable(get(name));\r\n    }\r\n\r\n"}}
{"actor":{"display_login":"sroughley"}}