replace method

PgEndpoint replace({
  1. String? host,
  2. int? port,
  3. String? database,
  4. String? username,
  5. String? password,
  6. bool? requireSsl,
  7. bool? isUnixSocket,
  8. String? applicationName()?,
})

Creates a new PgEndpoint by replacing the current values with non-null parameters.

Parameters with null values are ignored (keeping current value).

Implementation

PgEndpoint replace({
  String? host,
  int? port,
  String? database,
  String? username,
  String? password,
  bool? requireSsl,
  bool? isUnixSocket,
  String? Function()? applicationName,
}) {
  return PgEndpoint(
    host: host ?? this.host,
    port: port ?? this.port,
    database: database ?? this.database,
    username: username ?? this.username,
    password: password ?? this.password,
    requireSsl: requireSsl ?? this.requireSsl,
    isUnixSocket: isUnixSocket ?? this.isUnixSocket,
    applicationName:
        applicationName == null ? this.applicationName : applicationName(),
  );
}