Skip to content

provide configurable policy for handling 'nil' in collections #1

@bpsm

Description

@bpsm

Suggested policies:

  • Forbid nil. This is the current policy. A nil as a value or key in any collection will trigger a NullPointerException.
  • Elide nil. Nil elements in sets and lists will be omitted. Map entires with nil key or value will be omitted.
  • Always use optional: all elements of all collections will each be wrapped in an Optional.

Bonus points for:

  • Use optional when required: values or keys of any given collection may or may not each be wrapped in an Optional, depending on wether this particular collection contains at least one nil or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions