All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.metaloom.test.container.provider.DatabaseSettings Maven / Gradle / Ivy

There is a newer version: 0.1.4
Show newest version
package io.metaloom.test.container.provider;

public record DatabaseSettings(String host, int port, String internalHost, int internalPort, String username, String password, String adminDB) {

	public String jdbcUrl() {
		return ("jdbc:postgresql://" +
			host() +
			":" +
			port() +
			"/");
	}

	public String internalJdbcUrl() {
		return ("jdbc:postgresql://" +
			internalHost() +
			":" +
			internalPort() +
			"/");
	}

	public String toString() {
		return "Host: " + host() + ":" + port() + " IntHost:" + internalHost() + ":" + internalPort() + " , username: " + username() + ", password: "
			+ password() + ", adminDB: " + adminDB();
	}

	public String adminJdbcUrl() {
		return jdbcUrl() + adminDB;
	}

	public String internalAdminJdbcUrl() {
		return internalJdbcUrl() + adminDB;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy