Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README for Java 8 functional interface #27

Open
danizen opened this issue May 17, 2019 · 2 comments
Open

Update README for Java 8 functional interface #27

danizen opened this issue May 17, 2019 · 2 comments

Comments

@danizen
Copy link

danizen commented May 17, 2019

Since both FluentMatcher and FluentWebElementVistor are single function interfaces, they can be used with Java 8 lambda functions. This is wonderful! kudos.

Please update the README when discussing each of these to provide an example of the lambda equivalent, e.g.

// Note that FluentMatcher is also compatible with Java 8 lambda functions:
listofMatching elements = fwd.inputs(className("bar").filter(
    (FluentWebElement el, int ix) -> true
);

And similarly for FluentWebElementVisitor.

It would also be great to provide a stream of these, but that is more complicated and might break backwards compatibility with Java 7 compilation. I'd argue that this is still worth it - if your user is still using Java 7, they are likely not keeping up with Selenium changes, but since sometimes these must be done because of new browsers, I'll let you guys decide.

@paul-hammant
Copy link
Member

Excellent advice!!!

@paul-hammant
Copy link
Member

README expanded (with some copy/paste) 2861012

It might be OK to break backwards compatibility wit 5,6,7 now I think - re your stream() thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants