replace method
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(),
);
}