public OptionsStrategy create() { return new OptionsStrategy(this); } }
/** * Provides a configuration to a traversal in the form of a key value pair. The key of the configuration must be * graph provider specific and therefore a configuration could be supplied that is not known to be valid until * execution. This is a handy shortcut for building an {@link OptionsStrategy} manually and then add with * {@link #withStrategies(TraversalStrategy[])}. * * @param key the key of the configuration to apply to a traversal * @param value the value of the configuration to apply to a traversal * @return a new traversal source with the included configuration * @since 3.4.0 */ 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()); }
public static OptionsStrategy create(final Configuration configuration) { final Builder builder = build(); configuration.getKeys().forEachRemaining(k -> builder.with(k, configuration.getProperty(k))); return builder.create(); }
public static OptionsStrategy create(final Configuration configuration) { final Builder builder = build(); configuration.getKeys().forEachRemaining(k -> builder.with(k, configuration.getProperty(k))); return builder.create(); }
/** * Provides a configuration to a traversal in the form of a key value pair. The key of the configuration must be * graph provider specific and therefore a configuration could be supplied that is not known to be valid until * execution. This is a handy shortcut for building an {@link OptionsStrategy} manually and then add with * {@link #withStrategies(TraversalStrategy[])}. * * @param key the key of the configuration to apply to a traversal * @param value the value of the configuration to apply to a traversal * @return a new traversal source with the included configuration * @since 3.4.0 */ 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()); }
public OptionsStrategy create() { return new OptionsStrategy(this); } }