UserAgentMetadata.BrandVersion.Builder


public final 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 methods

@NonNull UserAgentMetadata.BrandVersion

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

@NonNull UserAgentMetadata.BrandVersion.Builder

Sets the BrandVersion's brand.

@NonNull UserAgentMetadata.BrandVersion.Builder

Sets the BrandVersion's fullVersion.

@NonNull UserAgentMetadata.BrandVersion.Builder

Sets the BrandVersion's majorVersion.

Public constructors

Builder

Added in 1.9.0
public Builder()

Create an empty BrandVersion Builder.

Builder

Added in 1.9.0
public Builder(@NonNull UserAgentMetadata.BrandVersion brandVersion)

Create a BrandVersion Builder from an existing BrandVersion object.

Public methods

build

Added in 1.9.0
public @NonNull UserAgentMetadata.BrandVersion build()

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

Returns
@NonNull 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
public @NonNull UserAgentMetadata.BrandVersion.Builder setBrand(@NonNull String brand)

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

Parameters
@NonNull String brand

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
public @NonNull UserAgentMetadata.BrandVersion.Builder setFullVersion(@NonNull String fullVersion)

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

Parameters
@NonNull String fullVersion

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

setMajorVersion

Added in 1.9.0
public @NonNull UserAgentMetadata.BrandVersion.Builder setMajorVersion(@NonNull String majorVersion)

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

Parameters
@NonNull String majorVersion

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