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

$.where if Tuple<String, T> used private Field have Exception #14

Closed
xiyoufang opened this issue Aug 13, 2015 · 3 comments
Closed

$.where if Tuple<String, T> used private Field have Exception #14

xiyoufang opened this issue Aug 13, 2015 · 3 comments

Comments

@xiyoufang
Copy link

private static final class WherePredicate<E, T> implements Predicate<E> {
    .....
    @Override
    public Boolean apply(final E elem) {
        for (Tuple<String, T> prop : properties) {
            try {
                if (!elem.getClass().getField(prop.fst()).get(elem)
                        .equals(prop.snd())) {
                    return false;
                }
            } catch (Exception ex) {
                ex.getMessage();
            }

The elem.getClass().getField(prop.fst()) can't get private Field .

@javadev
Copy link
Owner

javadev commented Aug 13, 2015

@xiyoufang I can add support for the getMethod() value comparition. Is it suitable solution for you?

@javadev
Copy link
Owner

javadev commented Aug 13, 2015

Pull request with fix is ready.

@xiyoufang
Copy link
Author

thanks

javadev added a commit that referenced this issue Aug 13, 2015
Add support for the method name in where() and findWhere(). #14
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