Module org.firebirdsql.jaybird
Package org.firebirdsql.gds.impl

# Record Class DbAttachInfo

java.lang.Object
java.lang.Record
org.firebirdsql.gds.impl.DbAttachInfo

@InternalApi public record DbAttachInfo(String serverName, int portNumber, String attachObjectName) extends Record
Container for attachment information (i.e. server, port and filename/alias/service name/url).

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DbAttachInfo(String serverName, int portNumber, String attachObjectName)`
  Creates an instance of a `DbAttachInfo` record class.
  `DbAttachInfo(String serverName, Integer portNumber, String attachObjectName)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `attachObjectName()`
  Returns the value of the `attachObjectName` record component.
  `<T extends IAttachProperties<T>>
  void`
  `copyTo(T attachProperties)`
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `boolean`
  `hasAttachObjectName()`
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `boolean`
  `hasServerName()`
  `static DbAttachInfo`
  `of(AttachmentProperties attachmentProperties)`
  `static DbAttachInfo`
  `parseConnectString(String connectString)`
  `int`
  `portNumber()`
  Returns the value of the `portNumber` record component.
  `String`
  `serverName()`
  Returns the value of the `serverName` record component.
  `final String`
  `toString()`
  Returns a string representation of this record class.
  `DbAttachInfo`
  `withAttachObjectName(String attachObjectName)`
  `DbAttachInfo`
  `withServerName(String serverName)`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DbAttachInfo

    public DbAttachInfo(String serverName, int portNumber, String attachObjectName)
    Creates an instance of a `DbAttachInfo` record class.
    Parameters:
      `serverName` - the value for the `serverName` record component
      `portNumber` - the value for the `portNumber` record component
      `attachObjectName` - the value for the `attachObjectName` record component

  - ### DbAttachInfo

    public DbAttachInfo(String serverName, Integer portNumber, String attachObjectName)

- ## Method Details

  - ### of

    public static DbAttachInfo of(AttachmentProperties attachmentProperties)

  - ### hasServerName

    public boolean hasServerName()

  - ### hasAttachObjectName

    public boolean hasAttachObjectName()

  - ### withServerName

    public DbAttachInfo withServerName(String serverName)

  - ### withAttachObjectName

    public DbAttachInfo withAttachObjectName(String attachObjectName)

  - ### copyTo

    public <T extends IAttachProperties<T>> void copyTo(T attachProperties)

  - ### parseConnectString

    public static DbAttachInfo parseConnectString(String connectString) throws SQLException
    Throws:
      `SQLException`

  - ### 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 '=='.
    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.

  - ### serverName

    public String serverName()
    Returns the value of the `serverName` record component.
    Returns:
      the value of the `serverName` record component

  - ### portNumber

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

  - ### attachObjectName

    public String attachObjectName()
    Returns the value of the `attachObjectName` record component.
    Returns:
      the value of the `attachObjectName` record component