Class ConnectionConfig.BuilderBase<BUILDER extends ConnectionConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ConnectionConfig>

java.lang.Object
io.helidon.data.sql.common.ConnectionConfig.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
ConnectionConfig.Builder, HikariDataSourceConfig.BuilderBase, JdbcDataSourceConfig.BuilderBase, UcpDataSourceConfig.BuilderBase
Enclosing interface:
ConnectionConfig

public abstract static class ConnectionConfig.BuilderBase<BUILDER extends ConnectionConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ConnectionConfig> extends Object implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for ConnectionConfig.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(ConnectionConfig prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(ConnectionConfig.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • config

      @Deprecated public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends ConnectionConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ConnectionConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends ConnectionConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ConnectionConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • url

      public BUILDER url(String url)
      Database connection url.
      Parameters:
      url - the connection url
      Returns:
      updated builder instance
      See Also:
    • clearUsername

      public BUILDER clearUsername()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • username

      public BUILDER username(String username)
      Username for the database connection.
      Parameters:
      username - the username
      Returns:
      updated builder instance
      See Also:
    • clearPassword

      public BUILDER clearPassword()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • password

      public BUILDER password(char[] password)
      Password for the database connection.
      Parameters:
      password - the password
      Returns:
      updated builder instance
      See Also:
    • password

      public BUILDER password(String password)
      Password for the database connection.
      Parameters:
      password - the password
      Returns:
      updated builder instance
      See Also:
    • clearJdbcDriverClassName

      public BUILDER clearJdbcDriverClassName()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • jdbcDriverClassName

      public BUILDER jdbcDriverClassName(String jdbcDriverClassName)
      JDBC driver class for database connection.
      Parameters:
      jdbcDriverClassName - the JDBC driver class name
      Returns:
      updated builder instance
      See Also:
    • url

      public Optional<String> url()
      Database connection url.
      Returns:
      the url
    • username

      public Optional<String> username()
      Username for the database connection.
      Returns:
      the username
    • password

      public Optional<char[]> password()
      Password for the database connection.
      Returns:
      the password
    • jdbcDriverClassName

      public Optional<String> jdbcDriverClassName()
      JDBC driver class for database connection.
      Returns:
      the jdbc driver class name
    • config

      public Optional<Config> config()
      If this instance was configured, this would be the config instance used.
      Returns:
      config node used to configure this builder, or empty if not configured
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.