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.
|
static ConnectionFactoryBuilder |
derivedFrom(io.r2dbc.spi.ConnectionFactory connectionFactory)
Initialize a new
ConnectionFactoryBuilder derived from the options of the
specified connectionFactory . |
static ConnectionFactoryBuilder |
derivefrom(io.r2dbc.spi.ConnectionFactory connectionFactory)
Deprecated.
since 2.5.1 for removal in 2.7.0 in favor of
derivedFrom(ConnectionFactory) |
ConnectionFactoryBuilder |
hostname(String host)
Configure the host name.
|
ConnectionFactoryBuilder |
password(CharSequence password)
Configure the password.
|
ConnectionFactoryBuilder |
port(int port)
Configure the port.
|
ConnectionFactoryBuilder |
username(String username)
Configure the username.
|
static ConnectionFactoryBuilder |
withOptions(io.r2dbc.spi.ConnectionFactoryOptions.Builder options)
Initialize a new
ConnectionFactoryBuilder based on the specified
options . |
static ConnectionFactoryBuilder |
withUrl(String url)
Initialize a new
ConnectionFactoryBuilder based on the specified R2DBC url. |
public static ConnectionFactoryBuilder withUrl(String url)
ConnectionFactoryBuilder
based on the specified R2DBC url.url
- the url to useEmbeddedDatabaseConnection.getUrl(String)
public static ConnectionFactoryBuilder withOptions(io.r2dbc.spi.ConnectionFactoryOptions.Builder options)
ConnectionFactoryBuilder
based on the specified
options
.options
- the options to use to initialize the builderoptions
@Deprecated public static ConnectionFactoryBuilder derivefrom(io.r2dbc.spi.ConnectionFactory connectionFactory)
derivedFrom(ConnectionFactory)
ConnectionFactoryBuilder
derived from the options of the
specified connectionFactory
.connectionFactory
- the connection factory whose options are to be used to
initialize the builderpublic static ConnectionFactoryBuilder derivedFrom(io.r2dbc.spi.ConnectionFactory connectionFactory)
ConnectionFactoryBuilder
derived from the options of the
specified connectionFactory
.connectionFactory
- the connection factory whose options are to be used to
initialize the builderpublic 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.