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

Create PredicateX#from(Predicate) #76

Closed
alexengrig opened this issue Aug 15, 2019 · 0 comments · Fixed by #79
Closed

Create PredicateX#from(Predicate) #76

alexengrig opened this issue Aug 15, 2019 · 0 comments · Fixed by #79
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@alexengrig
Copy link
Owner

alexengrig commented Aug 15, 2019

Use:

Predicate<Box> predicate = Box::isEmpty; // ok
Predicate<Box> predicate = Box::isEmpty.and(nextPredicate); // not work
Predicate<Box> predicate = PredicateX.from(Box::isEmpty).and(nextPredicate); // work

Implementation:

<T> Predicate<T> from(Predicate<? super T> checker) {
    return (Predicate<T>) checker;
}
@alexengrig alexengrig added the enhancement New feature or request label Aug 15, 2019
@alexengrig alexengrig added this to the v0.2.0 milestone Aug 15, 2019
@alexengrig alexengrig self-assigned this Aug 15, 2019
@alexengrig alexengrig changed the title Create PredicateX#of(Predicate) Create PredicateX#from(Predicate) Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant