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

make sure Filter predicates are always serializable #353

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

tyrasd
Copy link
Member

@tyrasd tyrasd commented Feb 16, 2021

Description

Makes sure users don't have to manually make supplied lambdas serializable when using Filter.by*.

Currently (0.6.*) users need to do this workaround when executing a query with a filter on ignite:

….filter(Filter.byOSMEntity((SerializablePredicate<OSMEntity>) e -> e.getVersion() == 42)

After this fix, this should be sufficient:

….filter(Filter.byOSMEntity(e -> e.getVersion() == 42)

This PR creates a local copy of the existing SerializablePredicate class as a an inner interface of the Filter class in order to avoid a circular dependency between the oshdb-filter and oshdb-api modules.

Checklist

@tyrasd tyrasd added the user experience Enhances the usability of OSHDB label Feb 16, 2021
@tyrasd tyrasd added this to the release 0.7.0 milestone Feb 16, 2021
@tyrasd tyrasd requested a review from rtroilo February 16, 2021 16:42
Copy link
Member

@rtroilo rtroilo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

creates a copy of the existing SerializablePredicate class in order to avoid a circular dependency.
@tyrasd tyrasd merged commit 46ec2eb into master Feb 17, 2021
@tyrasd tyrasd deleted the filter-predicates branch February 17, 2021 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user experience Enhances the usability of OSHDB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants