Skip to content

Preditates.sameAs #355

@gissuebot

Description

@gissuebot

Original issue created by ivankoblik on 2010-04-28 at 10:33 AM


Would be nice to have a standard predicate to do referential equality check.

Possible use case:
ImmutableSet<Object> filteredSet =
  ImmutableSet.copyOf(
    Collections2.filter(
      Predicates.not(
        Predicates.sameAs(objectToRemove)
  )));

I'm not sure how efficient it is, but it's a nifty way of "removing"
elements from immutable collections. Would be glad to learn if there's a
better way of doing it.

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