{"action":"opened","issue":{"url":"https://api.github.com/repos/rzwitserloot/lombok/issues/1214","repository_url":"https://api.github.com/repos/rzwitserloot/lombok","labels_url":"https://api.github.com/repos/rzwitserloot/lombok/issues/1214/labels{/name}","comments_url":"https://api.github.com/repos/rzwitserloot/lombok/issues/1214/comments","events_url":"https://api.github.com/repos/rzwitserloot/lombok/issues/1214/events","html_url":"https://github.com/rzwitserloot/lombok/issues/1214","id":184302967,"number":1214,"title":"Any reason why we can't have an OptionalGetter annotation?","user":{"login":"ownaginatious","id":1163192,"avatar_url":"https://avatars.githubusercontent.com/u/1163192?v=3","gravatar_id":"","url":"https://api.github.com/users/ownaginatious","html_url":"https://github.com/ownaginatious","followers_url":"https://api.github.com/users/ownaginatious/followers","following_url":"https://api.github.com/users/ownaginatious/following{/other_user}","gists_url":"https://api.github.com/users/ownaginatious/gists{/gist_id}","starred_url":"https://api.github.com/users/ownaginatious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ownaginatious/subscriptions","organizations_url":"https://api.github.com/users/ownaginatious/orgs","repos_url":"https://api.github.com/users/ownaginatious/repos","events_url":"https://api.github.com/users/ownaginatious/events{/privacy}","received_events_url":"https://api.github.com/users/ownaginatious/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-20T18:18:16Z","updated_at":"2016-10-20T18:18:16Z","closed_at":null,"body":"I've read the responses to `Optional` around here and how the authors seem to generally hate it, and I agree that it pretty much _never_ makes any sense to have an API take in some type `Optional<T>` parameter.\r\n\r\nHowever, are there any arguments against having something like this? I saw something similar posted in this issue [here](https://github.com/rzwitserloot/lombok/issues/1125), but it was never addressed before being closed.\r\n\r\n```java\r\npublic class Foo {\r\n    @NonNull @OptionalGetter @Setter\r\n    private String bar;\r\n}\r\n```\r\n```java\r\npublic class Foo {\r\n    private String bar;\r\n\r\n    public Optional<String> getBar() {\r\n        return Optional.ofNullable(bar);\r\n    }\r\n\r\n    public void setBar(@NonNull String bar) {\r\n        this.bar = bar;\r\n    }\r\n}\r\n```\r\nThere are a lot of instances where I'd like to more clearly indicate \"no value set yet\" rather than just making it `null`."}}
{"actor":{"display_login":"ownaginatious"}}