UserAgentMetadata.BrandVersion.Builder


class UserAgentMetadata.BrandVersion.Builder


Builder used to create BrandVersion objects.

Examples:

 // Create a setting with a brand version contains brand name: myBrand,
 // major version: 100, full version: 100.1.1.1.
 new BrandVersion.Builder().setBrand("myBrand")
                           .setMajorVersion("100")
                           .setFullVersion("100.1.1.1")
                           .build();

Summary

Public constructors

Create an empty BrandVersion Builder.

Create a BrandVersion Builder from an existing BrandVersion object.

Public functions

UserAgentMetadata.BrandVersion

Builds the current brand, majorVersion and fullVersion into a BrandVersion object.

UserAgentMetadata.BrandVersion.Builder
setBrand(brand: String)

Sets the BrandVersion's brand.

UserAgentMetadata.BrandVersion.Builder
setFullVersion(fullVersion: String)

Sets the BrandVersion's fullVersion.

UserAgentMetadata.BrandVersion.Builder
setMajorVersion(majorVersion: String)

Sets the BrandVersion's majorVersion.

Public constructors

Builder

Added in 1.9.0
Builder()

Create an empty BrandVersion Builder.

Builder

Added in 1.9.0
Builder(brandVersion: UserAgentMetadata.BrandVersion)

Create a BrandVersion Builder from an existing BrandVersion object.

Public functions

build

Added in 1.9.0
fun build(): UserAgentMetadata.BrandVersion

Builds the current brand, majorVersion and fullVersion into a BrandVersion object.

Returns
UserAgentMetadata.BrandVersion

The BrandVersion object represented by this Builder.

Throws
java.lang.IllegalStateException

If any of the value in brand, majorVersion and fullVersion is null or blank.

setBrand

Added in 1.9.0
fun setBrand(brand: String): UserAgentMetadata.BrandVersion.Builder

Sets the BrandVersion's brand. The brand should not be blank.

Parameters
brand: String

The brand is used to generate user-agent client hint sec-ch-ua and sec-ch-ua-full-version-list.

setFullVersion

Added in 1.9.0
fun setFullVersion(fullVersion: String): UserAgentMetadata.BrandVersion.Builder

Sets the BrandVersion's fullVersion. The fullVersion should not be blank.

Parameters
fullVersion: String

The brand is used to generate user-agent client hint sec-ch-ua-full-version-list.

setMajorVersion

Added in 1.9.0
fun setMajorVersion(majorVersion: String): UserAgentMetadata.BrandVersion.Builder

Sets the BrandVersion's majorVersion. The majorVersion should not be blank.

Parameters
majorVersion: String

The majorVersion is used to generate user-agent client hint sec-ch-ua.