Record Class PostgresSettings

java.lang.Object
java.lang.Record
com.iantapply.orchestra.adapter.postgres.PostgresSettings
Record Components:
jdbcUrl - PostgreSQL JDBC URL
username - database username
password - database password
maximumPoolSize - maximum number of pooled connections

public record PostgresSettings(String jdbcUrl, String username, String password, int maximumPoolSize) extends Record
Validated PostgreSQL connection-pool settings.
  • Constructor Details

    • PostgresSettings

      public PostgresSettings(String jdbcUrl, String username, String password, int maximumPoolSize)
      Validates the JDBC URL and normalizes the pool size.
  • Method Details

    • openDataSource

      public com.zaxxer.hikari.HikariDataSource openDataSource()
      Opens a configured connection pool.
      Returns:
      newly opened HikariCP data source owned by the caller
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • jdbcUrl

      public String jdbcUrl()
      Returns the value of the jdbcUrl record component.
      Returns:
      the value of the jdbcUrl record component
    • username

      public String username()
      Returns the value of the username record component.
      Returns:
      the value of the username record component
    • password

      public String password()
      Returns the value of the password record component.
      Returns:
      the value of the password record component
    • maximumPoolSize

      public int maximumPoolSize()
      Returns the value of the maximumPoolSize record component.
      Returns:
      the value of the maximumPoolSize record component