public final class ConnectionFactoryBuilder extends Object
ConnectionFactory
.Modifier and Type | Method and Description |
---|---|
io.r2dbc.spi.ConnectionFactory |
build()
Build a
ConnectionFactory based on the state of this builder. |
io.r2dbc.spi.ConnectionFactoryOptions |
buildOptions()
Build a
ConnectionFactoryOptions based on the state of this builder. |
ConnectionFactoryBuilder |
configure(Consumer<io.r2dbc.spi.ConnectionFactoryOptions.Builder> options)
Configure additional options.
|
ConnectionFactoryBuilder |
database(String database)
Configure the database.
|
ConnectionFactoryBuilder |
hostname(String host)
Configure the host name.
|
static ConnectionFactoryBuilder |
of(R2dbcProperties properties,
Supplier<EmbeddedDatabaseConnection> embeddedDatabaseConnection)
Initialize a new
ConnectionFactoryBuilder based on the specified
R2dbcProperties . |
ConnectionFactoryBuilder |
password(CharSequence password)
Configure the password.
|
ConnectionFactoryBuilder |
port(int port)
Configure the port.
|
ConnectionFactoryBuilder |
username(String username)
Configure the username.
|
public static ConnectionFactoryBuilder of(R2dbcProperties properties, Supplier<EmbeddedDatabaseConnection> embeddedDatabaseConnection)
ConnectionFactoryBuilder
based on the specified
R2dbcProperties
. If no url is specified, the
EmbeddedDatabaseConnection
supplier is invoked to determine if an embedded
database can be configured instead.properties
- the properties to use to initialize the builderembeddedDatabaseConnection
- a supplier for an
EmbeddedDatabaseConnection
R2dbcProperties
public ConnectionFactoryBuilder configure(Consumer<io.r2dbc.spi.ConnectionFactoryOptions.Builder> options)
options
- a Consumer
to customize the optionspublic ConnectionFactoryBuilder username(String username)
username
- the connection factory usernamepublic ConnectionFactoryBuilder password(CharSequence password)
password
- the connection factory passwordpublic ConnectionFactoryBuilder hostname(String host)
host
- the connection factory hostnamepublic ConnectionFactoryBuilder port(int port)
port
- the connection factory portpublic ConnectionFactoryBuilder database(String database)
database
- the connection factory databasepublic io.r2dbc.spi.ConnectionFactory build()
ConnectionFactory
based on the state of this builder.public io.r2dbc.spi.ConnectionFactoryOptions buildOptions()
ConnectionFactoryOptions
based on the state of this builder.