Skip to content
This repository was archived by the owner on Nov 23, 2023. It is now read-only.

Fix PredicateX#map #89

Closed
alexengrig opened this issue Sep 27, 2019 · 0 comments · Fixed by #93
Closed

Fix PredicateX#map #89

alexengrig opened this issue Sep 27, 2019 · 0 comments · Fixed by #93
Assignees
Labels
bug Something isn't working
Milestone

Comments

@alexengrig
Copy link
Owner

Describe the bug
Cannot resolve method 'map(java.util.function.Function<java.util.Map<? extends K,? extends V>,V>)'

Target
Method: PredicateX#map and MapX#get

Code

class Entry {
    private Map<Integer, String> numbers;
}

<...>

List<String> numbers = entries.stream()
    .filter(PredicateX.of(Entry::getNumbers)
                    // .map(MapX.get(1)) // doesn't work
                    // .map(m -> m.get(1)) // doesn't work
                    .map((Map<Integer, String> m) -> m.get(1)) // works
                    .nonNull())
    .collect(Collectors.toList());
@alexengrig alexengrig added the bug Something isn't working label Sep 27, 2019
@alexengrig alexengrig added this to the v0.2.1 milestone Sep 27, 2019
@alexengrig alexengrig self-assigned this Sep 27, 2019
@alexengrig alexengrig changed the title Fix Class#method Fix PredicateX#map Sep 27, 2019
alexengrig added a commit that referenced this issue Feb 25, 2020
@alexengrig alexengrig linked a pull request Feb 25, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant