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

FeatureMatcher factory method for java 8 users #203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

FeatureMatcher factory method for java 8 users #203

wants to merge 1 commit into from

Conversation

leaumar
Copy link

@leaumar leaumar commented May 16, 2018

This simple addition allows users on java 8 to do this:

FeatureMatcher.ofFunction(Thing::calculateName, containsString("foo"), "calculated name contains foo", "calculateName")

instead of

new FeatureMatcher(containsString("foo"), "calculated name contains foo", "calculateName") {
  @Override
  protected String featureValueOf(Thing actual) {
    return actual.calculateName();
  }
}

Less verbose/more concise, more pleasant to work with, and does not require hamcrest to be updated to java 8 or anything.

@nhojpatrick
Copy link
Member

@leaumar looking at getting java 8, 11 and newer support into hamcrest, please can you rebase from master, as hamcrest-core and hamcrest-library have been refactored a lot and also deprecated, so that everything is just in hamcrest.

@nhojpatrick
Copy link
Member

Going to try and kick start hamcrest, so if you want to get it merged, please rebase from the branch feature/v3.x-ea.
Still trying to understand how has permissions to perform a release.
Looking to keep v2.x as java 7, with v3 bumping to java 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Needs triage
Development

Successfully merging this pull request may close these issues.

2 participants