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

TINKERPOP-2061 Added with() option for traversal configuration #961

Merged
merged 1 commit into from
Oct 22, 2018

Conversation

spmallette
Copy link
Contributor

https://issues.apache.org/jira/browse/TINKERPOP-2061

Basically just shorthands the direct use of OptionStrategy which is much more verbose and less nice to look at. See the upgrade doc changes in this PR for an example of usage.

All tests pass with docker/build.sh -t -n -i

VOTE +1

Copy link
Contributor

@dkuppitz dkuppitz left a comment

Choose a reason for hiding this comment

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

VOTE +1

strategy.getOptions().forEach(builder::with);
builder.with(key, value);
return withStrategies(builder.create());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps a little bit more elegant:

    public default TraversalSource with(final String key, final Object value) {
        final OptionsStrategy.Builder builder = OptionsStrategy.build();
        getStrategies().getStrategy(OptionsStrategy.class)
                .ifPresent(optionsStrategy -> optionsStrategy.getOptions().forEach(builder::with));
        builder.with(key, value);
        return withStrategies(builder.create());
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Basically just shorthands the direct use of OptionStrategy which is much more verbose and less nice to look at.
@spmallette spmallette merged commit 11f9949 into master Oct 22, 2018
@spmallette spmallette deleted the TINKERPOP-2061 branch October 22, 2018 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants