java.lang.Object
org.neo4j.cypherdsl.parser.Options.Builder
- Enclosing class:
- Options
Use this builder to create a new set of options..
-
Method Summary
Modifier and TypeMethodDescriptionbuild()<T extends org.neo4j.cypherdsl.core.Expression>
Options.BuilderwithCallback(ExpressionCreatedEventType expressionCreatedEventType, Class<T> resultingType, Function<org.neo4j.cypherdsl.core.Expression, T> callback) Adds a callback for when the specificexpression is createdevent.<T extends org.neo4j.cypherdsl.core.ast.Visitable>
Options.BuilderwithCallback(InvocationCreatedEventType invocationCreatedEventType, Class<T> resultingType, UnaryOperator<T> callback) Adds a callback for when either a CALL-Procedure clause or a function-invocation expression is created.withCallback(PatternElementCreatedEventType patternElementCreatedEventType, UnaryOperator<org.neo4j.cypherdsl.core.PatternElement> callback) Adds a callback for when aPatternElementis created during one of the phases described byPatternElementCreatedEventType.withLabelFilter(BiFunction<LabelParsedEventType, Collection<String>, Collection<String>> labelFilter) Configure a filter that is applied to labels.withReturnClauseFactory(@Nullable Function<ReturnDefinition, org.neo4j.cypherdsl.core.Return> returnClauseFactory) Configures the factory for return clauses.withTypeFilter(BiFunction<TypeParsedEventType, Collection<String>, Collection<String>> typeFilter) Configure a filter that is applied to types.
-
Method Details
-
withLabelFilter
public Options.Builder withLabelFilter(BiFunction<LabelParsedEventType, Collection<String>, Collection<String>> labelFilter) Configure a filter that is applied to labels.- Parameters:
labelFilter- Takes in an event type, a collection of labels and returns a probably new collection of labels.- Returns:
- This builder.
-
withTypeFilter
public Options.Builder withTypeFilter(BiFunction<TypeParsedEventType, Collection<String>, Collection<String>> typeFilter) Configure a filter that is applied to types.- Parameters:
typeFilter- Takes in an event type and the parsed type. May return the type itself or something else.- Returns:
- This builder.
-
withCallback
public <T extends org.neo4j.cypherdsl.core.Expression> Options.Builder withCallback(ExpressionCreatedEventType expressionCreatedEventType, Class<T> resultingType, Function<org.neo4j.cypherdsl.core.Expression, T> callback) Adds a callback for when the specificexpression is createdevent. For one type of event one or more callbacks can be declared which will be called in order in which they have been declared.Parsing will be aborted when a callback throws a
RuntimeException.- Type Parameters:
T- The type of the expression produced by the callback. Must match the one of the event type- Parameters:
expressionCreatedEventType- The type of the eventresultingType- The type of the expression the callback returns. Must match the one of the event type.callback- A callback- Returns:
- This builder
-
withCallback
public Options.Builder withCallback(PatternElementCreatedEventType patternElementCreatedEventType, UnaryOperator<org.neo4j.cypherdsl.core.PatternElement> callback) Adds a callback for when aPatternElementis created during one of the phases described byPatternElementCreatedEventType. For one type of event one or more callbacks can be declared which will be called in order in which they have been declared. Callbacks can just collect or actually visit the elements created or they are free to create new ones, effectively rewriting the query.Parsing will be aborted when a callback throws a
RuntimeException.- Parameters:
patternElementCreatedEventType- The type of the eventcallback- A callback- Returns:
- This builder
- Since:
- 2022.2.0
-
withCallback
public <T extends org.neo4j.cypherdsl.core.ast.Visitable> Options.Builder withCallback(InvocationCreatedEventType invocationCreatedEventType, Class<T> resultingType, UnaryOperator<T> callback) Adds a callback for when either a CALL-Procedure clause or a function-invocation expression is created. For one type of event one or more callbacks can be declared which will be called in order in which they have been declared. Callbacks can just collect or actually visit the elements created, or they are free to create new ones, effectively rewriting the query.Parsing will be aborted when a callback throws a
RuntimeException.- Type Parameters:
T- The type of the result, must match the one of the event- Parameters:
invocationCreatedEventType- The event typecallback- A callback- Returns:
- this builder
- Since:
- 2022.8.6
-
withReturnClauseFactory
public Options.Builder withReturnClauseFactory(@Nullable @Nullable Function<ReturnDefinition, org.neo4j.cypherdsl.core.Return> returnClauseFactory) Configures the factory for return clauses. The idea here is that you might intercept what is being returned or how it is sorted, limited and the like. Thedefinitionpassed to the factory contains all necessary information for delegating to theClauses.returning(boolean, List, List, Expression, Expression)factory.- Parameters:
returnClauseFactory- The factory producing return classes that should be used.- Returns:
- This builder
-
build
- Returns:
- A new, unmodifiable
options instance.
-