[
https://issues.apache.org/jira/browse/AVRO-1961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15694408#comment-15694408
]
Niels Basjes commented on AVRO-1961:
------------------------------------
Hi,
First of all let me make clear my experience in using Optionals is very
limited, so I have a lot to learn and welcome any advice in this matter.
I create the 'Optional' variant for everything because that is the easiest to
implement. Finding out if a field is nullable in the code generator is
something I need to look into if that is needed.
The reason I left both the regular and the Optional versions remain side by
side is because I expect that in existing applications it would be too hard to
switch from one to the other overnight. Perhaps I'm wrong in this, perhaps we
should have a flag to do the switch completely as you suggested.
I hadn't thought of the setters yet. For those I do think we must have both as
the type system of Java will pick the right one depending on the type you call
it with.
> [JAVA] Generate getters that return an Optional
> -----------------------------------------------
>
> Key: AVRO-1961
> URL: https://issues.apache.org/jira/browse/AVRO-1961
> Project: Avro
> Issue Type: New Feature
> Reporter: Niels Basjes
> Assignee: Niels Basjes
> Priority: Minor
>
> A colleague of mine indicated that having getters that return an Optional
> (java 8 thingy) would be very useful for him.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)