Class Configuration.Builder

java.lang.Object
org.neo4j.cypherdsl.core.renderer.Configuration.Builder
Enclosing class:
Configuration

public static final class Configuration.Builder extends Object
Use this builder to create new Configuration instances.
  • Method Details

    • withPrettyPrint

      public Configuration.Builder withPrettyPrint(boolean prettyPrint)
      Enables or disables pretty printing. Enabling pretty printing will disable unnecessary escaping of labels and types.
      Parameters:
      prettyPrint - use true for enabling pretty printing
      Returns:
      this builder
    • withIndentStyle

      public Configuration.Builder withIndentStyle(Configuration.IndentStyle indentStyle)
      Parameters:
      indentStyle - The new indentation style
      Returns:
      this builder
    • withIndentSize

      public Configuration.Builder withIndentSize(int indentSize)
      Parameters:
      indentSize - The new indentation size
      Returns:
      this builder
    • alwaysEscapeNames

      public Configuration.Builder alwaysEscapeNames(boolean alwaysEscapeNames)
      Configure whether names should be always escaped.
      Parameters:
      alwaysEscapeNames - use true to always escape names
      Returns:
      this builder
    • withGeneratedNames

      public Configuration.Builder withGeneratedNames(boolean useGeneratedNames)
      Configure whether variable names should be always generated.
      Parameters:
      useGeneratedNames - Set to true to use generated symbolic names, parameter names and aliases
      Returns:
      this builder
    • withGeneratedNames

      public Configuration.Builder withGeneratedNames(Set<Configuration.GeneratedNames> useGeneratedNames)
      Configure for which type of object generated names should be used.
      Parameters:
      useGeneratedNames - The set of objects for which generated names should be used
      Returns:
      this builder
    • withDialect

      public Configuration.Builder withDialect(Dialect dialect)
      Use a configuration with a dialect fitting your target database if the default dialect for Neo4j 4.x and earlier leads to incompatible results with your version of Neo4j.
      Parameters:
      dialect - The new dialect
      Returns:
      This builder. You can both use the original or this instance.
      Since:
      2022.3.0
    • withRelationshipDefinition

      @API(status=EXPERIMENTAL, since="2023.7.0") public Configuration.Builder withRelationshipDefinition(Configuration.RelationshipDefinition relationshipDefinition)
      Adds a new relationship definition to the current schema.
      Parameters:
      relationshipDefinition - A new relationship definition
      Returns:
      this builder
      Since:
      2023.7.0
    • withEnforceSchema

      @API(status=EXPERIMENTAL, since="2023.7.0") public Configuration.Builder withEnforceSchema(boolean enforceSchema)
      Configure whether to enforce a schema or not.
      Parameters:
      enforceSchema - Set to true to enforce the schema defined by known relationship definitions.
      Returns:
      this builder
      Since:
      2023.7.0
    • build

      public Configuration build()
      Returns:
      a new immutable configuration