Enum ClickHouseClientOption

java.lang.Object
java.lang.Enum<ClickHouseClientOption>
com.clickhouse.client.config.ClickHouseClientOption
All Implemented Interfaces:
ClickHouseOption, Serializable, Comparable<ClickHouseClientOption>, java.lang.constant.Constable

public enum ClickHouseClientOption extends Enum<ClickHouseClientOption> implements ClickHouseOption
Generic client options.
  • Enum Constant Details

  • Field Details

    • LATEST_KNOWN_VERSION

      public static final String LATEST_KNOWN_VERSION
      See Also:
    • PRODUCT_VERSION

      public static final String PRODUCT_VERSION
      Semantic version of the product.
    • PRODUCT_REVISION

      public static final String PRODUCT_REVISION
      Revision(shortened git commit hash) of the product.
    • CLIENT_OS_INFO

      public static final String CLIENT_OS_INFO
      Client O/S information in format of <o/s name>/<o/s version>.
    • CLIENT_JVM_INFO

      public static final String CLIENT_JVM_INFO
      Client JVM information in format of <jvm name>/<jvm version>.
    • CLIENT_USER

      public static final String CLIENT_USER
      Client user name.
    • CLIENT_HOST

      public static final String CLIENT_HOST
      Client host name.
  • Method Details

    • values

      public static ClickHouseClientOption[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ClickHouseClientOption valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • readVersionFromResource

      public static String readVersionFromResource(String resourceFilePath)
    • buildUserAgent

      public static String buildUserAgent(String productName, String additionalProperty)
      Builds user-agent based on given product name. The user-agent will be something look like <product name>/<product version> (<o/s name>/<o/s version>; <jvm name>/<jvm version>[; <additionalProperty>]; rv:<product revision>).
      Parameters:
      productName - product name, null or blank string is treated as ClickHouse Java Client
      additionalProperty - additional property if any
      Returns:
      non-empty user-agent
    • getSystemConfig

      public static String getSystemConfig(String propertyName, String defaultValue)
      Gets system property and fall back to the given value as needed.
      Parameters:
      propertyName - non-null property name
      defaultValue - default value, only useful if it's not null
      Returns:
      property value
    • fromKey

      public static ClickHouseClientOption fromKey(String key)
      Gets client option by key.
      Parameters:
      key - key of the option
      Returns:
      client option object, or null if not found
    • getDefaultValue

      public Serializable getDefaultValue()
      Specified by:
      getDefaultValue in interface ClickHouseOption
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface ClickHouseOption
    • getKey

      public String getKey()
      Specified by:
      getKey in interface ClickHouseOption
    • getValueType

      public Class<? extends Serializable> getValueType()
      Specified by:
      getValueType in interface ClickHouseOption
    • isSensitive

      public boolean isSensitive()
      Specified by:
      isSensitive in interface ClickHouseOption