sdk-java: Returning empty values

From https://github.com/cloudevents/sdk-java/issues/119 and https://github.com/cloudevents/sdk-java/pull/108#discussion_r411193730:

What technique should we use, around the sdk, to notify the user of an eventual empty return value?

  1. Optional getters
  2. Have an annotation called @Nullable which notifies the user of an eventual null return value
  3. Just explicit in the Javadoc that a method can return null

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (16 by maintainers)

Commits related to this issue

Most upvoted comments

That said, the same annotation can definitely be used in other modules +1

I would love to, to keep consistency across our modules

@slinkydeveloper I would agree with you if not the usages tab of that dependency where you will find a ton of major Java projects 😉

Anyway, are you willing to provide a PR to add them to api package?

Sure! Expect a PR soon