Class UserAgentUtil

java.lang.Object
com.azure.core.util.UserAgentUtil

public final class UserAgentUtil extends Object
Utility for building user agent string for Azure client libraries as specified in the design guidelines.
  • Field Details

    • DEFAULT_USER_AGENT_HEADER

      public static final String DEFAULT_USER_AGENT_HEADER
      Default UserAgent header.
      See Also:
  • Method Details

    • toUserAgentString

      public static String toUserAgentString(String applicationId, String sdkName, String sdkVersion, Configuration configuration)
      Return user agent string for the given sdk name and version.
      Parameters:
      applicationId - Name of the application.
      sdkName - Name of the SDK.
      sdkVersion - Version of the SDK.
      configuration - The configuration to use to determine if platform info should be included in the user agent string.
      Returns:
      User agent string as specified in design guidelines.
      Throws:
      IllegalArgumentException - If applicationId contains spaces or is larger than 24 characters in length.