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

# Class GDSServerVersion

java.lang.Object
org.firebirdsql.gds.impl.GDSServerVersion

All Implemented Interfaces:
  `Serializable`

public final class GDSServerVersion extends Object implements Serializable
Object representing a Firebird server version. The version string is returned in response to the `isc_info_firebird_version` information call. Expected version format is:

`<platform>-<type><majorVersion>.<minorVersion>.<variant>.<buildNum>[-<revision>] <serverName>`, and additional version string elements if present.

where `platform` is a two-character platform identification string, Windows for example is "WI", `type` is one of the three characters: "V" - production version, "T" - beta version, "X" - development version.

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `CONNECTION_OPTION_COMPRESSION`
  `static final String`
  `CONNECTION_OPTION_ENCRYPTED`
  `static final GDSServerVersion`
  `INVALID_VERSION`
  GDSServerVersion that can be used as a dummy/invalid object when a version object is required, but none is available.
  `static final String`
  `TYPE_BETA`
  `static final String`
  `TYPE_DEVELOPMENT`
  `static final String`
  `TYPE_PRODUCTION`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `int`
  `getBuildNumber()`
  `String`
  `getExtendedServerName()`
  `String`
  `getFullVersion()`
  `int`
  `getMajorVersion()`
  `int`
  `getMinorVersion()`
  `String`
  `getPlatform()`
  `int`
  `getProtocolVersion()`
  `List<String>`
  `getRawVersions()`
  `String`
  `getServerName()`
  `String`
  `getType()`
  `int`
  `getVariant()`
  `int`
  `hashCode()`
  `boolean`
  `isEqualOrAbove(int requiredMajorVersion)`
  Convenience method to check if the major of this version is equal to or larger than the specified required version.
  `boolean`
  `isEqualOrAbove(int requiredMajorVersion, int requiredMinorVersion)`
  Convenience method to check if the major.minor of this version is equal to or larger than the specified required version.
  `boolean`
  `isEqualOrAbove(int requiredMajorVersion, int requiredMinorVersion, int requiredVariant)`
  Convenience method to check if the major.minor.variant of this version is equal to or larger than the specified required version.
  `boolean`
  `isWireCompressionUsed()`
  `boolean`
  `isWireEncryptionUsed()`
  `static GDSServerVersion`
  `parseRawVersion(String... versionStrings)`
  Parse the raw version string and create a GDSServerVersion object.
  `String`
  `toString()`

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

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

- ## Field Details

  - ### TYPE_PRODUCTION

    public static final String TYPE_PRODUCTION
    See Also:
      - Constant Field Values

  - ### TYPE_BETA

    public static final String TYPE_BETA
    See Also:
      - Constant Field Values

  - ### TYPE_DEVELOPMENT

    public static final String TYPE_DEVELOPMENT
    See Also:
      - Constant Field Values

  - ### CONNECTION_OPTION_ENCRYPTED

    public static final String CONNECTION_OPTION_ENCRYPTED
    See Also:
      - Constant Field Values

  - ### CONNECTION_OPTION_COMPRESSION

    public static final String CONNECTION_OPTION_COMPRESSION
    See Also:
      - Constant Field Values

  - ### INVALID_VERSION

    public static final GDSServerVersion INVALID_VERSION
    GDSServerVersion that can be used as a dummy/invalid object when a version object is required, but none is available.

- ## Method Details

  - ### getBuildNumber

    public int getBuildNumber()

  - ### getMajorVersion

    public int getMajorVersion()

  - ### getMinorVersion

    public int getMinorVersion()

  - ### getPlatform

    public String getPlatform()

  - ### getServerName

    public String getServerName()

  - ### getType

    public String getType()

  - ### getVariant

    public int getVariant()

  - ### getRawVersions

    public List<String> getRawVersions()
    Returns:
      an unmodifiable list of the raw version strings
    Since:
      6.0.2

  - ### getExtendedServerName

    public String getExtendedServerName()

  - ### getFullVersion

    public String getFullVersion()

  - ### getProtocolVersion

    public int getProtocolVersion()
    Returns:
      Protocol version of the connection, or `-1` if this information is not available.

  - ### isWireEncryptionUsed

    public boolean isWireEncryptionUsed()
    Returns:
      `true` if encryption is used, `false` if no encryption is used or if this information is not available

  - ### isWireCompressionUsed

    public boolean isWireCompressionUsed()

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### parseRawVersion

    public static GDSServerVersion parseRawVersion(String... versionStrings) throws GDSServerVersionException
    Parse the raw version string and create a GDSServerVersion object.
    Parameters:
      `versionStrings` - strings to parse, expects a non-empty array with at least 1, and usually 2 version strings
    Throws:
      `GDSServerVersionException` - if versionString does not match expected pattern

  - ### isEqualOrAbove

    public boolean isEqualOrAbove(int requiredMajorVersion)
    Convenience method to check if the major of this version is equal to or larger than the specified required version.
    Parameters:
      `requiredMajorVersion` - Required major version
    Returns:
      `true` when current major is equal to or larger than required
    Since:
      6

  - ### isEqualOrAbove

    public boolean isEqualOrAbove(int requiredMajorVersion, int requiredMinorVersion)
    Convenience method to check if the major.minor of this version is equal to or larger than the specified required version.
    Parameters:
      `requiredMajorVersion` - Required major version
      `requiredMinorVersion` - Required minor version
    Returns:
      `true` when current major is larger than required, or major is same and minor is equal to or larger than required

  - ### isEqualOrAbove

    public boolean isEqualOrAbove(int requiredMajorVersion, int requiredMinorVersion, int requiredVariant)
    Convenience method to check if the major.minor.variant of this version is equal to or larger than the specified required version.
    Parameters:
      `requiredMajorVersion` - Required major version
      `requiredMinorVersion` - Required minor version
      `requiredVariant` - Required variant version
    Returns:
      `true` when current major is larger than required, or major is same and minor is equal to required and variant equal to or larger than required, or major is same and minor is larger than required