Skip to content

Efficient conversion to read-only java.util.List/Set/Map #9

@odenix

Description

@odenix

Currently, converting to java.util.List/Set/Map requires a full copy.

Options:

  1. Add ImmutableList/Set/Map.asJava() that returns a read-only java.util.List/Set/Map view
  2. Change ImmutableList/Set/Map to extend java.util.List/Set/Map
    Currently impossible due to method name clashes, but upstream is considering to rename add -> adding, etc.

(1) gives a cleaner API and implementation, whereas (2) avoids the downsides of wrapping.

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