Class ConnectionCredentials

java.lang.Object
io.github.mfvanek.pg.connection.ConnectionCredentials

@Immutable public class ConnectionCredentials extends Object
Parameters for connecting to the database.
  • Method Details

    • getConnectionUrls

      @Nonnull public Collection<String> getConnectionUrls()
      Gets a set of connection strings for accessing all hosts in the database cluster.
      Returns:
      connection urls
    • getUserName

      @Nonnull public String getUserName()
      Gets the name of the user to connect to the database.
      Returns:
      the name of the user
    • getPassword

      @Nonnull public String getPassword()
      Gets the user's password for connecting to the database.
      Returns:
      the user's password
    • equals

      public final boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • of

      @Nonnull public static ConnectionCredentials of(@Nonnull Collection<String> connectionUrls, @Nonnull String userName, @Nonnull String password)
    • ofUrl

      @Nonnull public static ConnectionCredentials ofUrl(@Nonnull String writeUrl, @Nonnull String userName, @Nonnull String password)