Skip to content

ImmutableMap.Builder should have remove method #3596

Closed
@dapengzhang0

Description

@dapengzhang0

Without Builder.remove() method, it will be very inefficient to create a new immutable map from an existing immutable map removing a key:

Map newMapWithoutKey1 = ImmutableMap.builder()
    .putAll(map)
    .remove("key1")
    .build();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions