Class PgHostImpl

java.lang.Object
io.github.mfvanek.pg.connection.PgHostImpl
All Implemented Interfaces:
PgHost

@Immutable public class PgHostImpl extends Object implements PgHost
  • Method Details

    • getPgUrl

      @Nonnull public String getPgUrl()
      Gets a valid connection string to this host.
      Specified by:
      getPgUrl in interface PgHost
      Returns:
      connection url to the host
    • getName

      @Nonnull public String getName()
      Gets the name of this host.
      Specified by:
      getName in interface PgHost
      Returns:
      host name
    • canBePrimary

      public boolean canBePrimary()
      Determines whether this host can be a primary host.
      Specified by:
      canBePrimary in interface PgHost
      Returns:
      true if this host can be a primary host
    • ofPrimary

      @Nonnull public static PgHost ofPrimary()
    • ofUrl

      @Nonnull public static PgHost ofUrl(@Nonnull String pgUrl)
    • ofName

      @Nonnull public static PgHost ofName(@Nonnull String hostName)
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object