UserAgentMetadata


class UserAgentMetadata


Holds user-agent metadata information and uses to generate user-agent client hints.

This class is functionally equivalent to UADataValues.

Summary

Nested types

Class that holds brand name, major version and full version.

Builder used to create BrandVersion objects.

Builder used to create UserAgentMetadata objects.

Constants

const Int

Use this value for bitness to use the platform's default bitness value, which is an empty string for Android WebView.

Public functions

Boolean
equals(o: Any!)

Two UserAgentMetadata objects are equal only if all the metadata values are equal.

String?

Returns the value for the sec-ch-ua-arch client hint.

Int

Returns the value for the sec-ch-ua-bitness client hint.

(Mutable)List<UserAgentMetadata.BrandVersion!>

Returns the current list of user-agent brand versions which are used to populate user-agent client hints sec-ch-ua and sec-ch-ua-full-version-list.

String?

Returns the value for the sec-ch-ua-full-version client hint.

String?

Returns the value for the sec-ch-ua-model client hint.

String?

Returns the value for the sec-ch-ua-platform client hint.

String?

Returns the value for the sec-ch-ua-platform-version client hint.

Int
Boolean

Returns the value for the sec-ch-ua-mobile client hint.

Boolean

Returns the value for the sec-ch-ua-wow64 client hint.

Constants

BITNESS_DEFAULT

Added in 1.9.0
const val BITNESS_DEFAULT = 0: Int

Use this value for bitness to use the platform's default bitness value, which is an empty string for Android WebView.

Public functions

equals

fun equals(o: Any!): Boolean

Two UserAgentMetadata objects are equal only if all the metadata values are equal.

getArchitecture

Added in 1.9.0
fun getArchitecture(): String?

Returns the value for the sec-ch-ua-arch client hint.

See also
setArchitecture

getBitness

Added in 1.9.0
fun getBitness(): Int

Returns the value for the sec-ch-ua-bitness client hint.

Returns
Int

An integer indicates the CPU bitness, the integer value will convert to string when generating the user-agent client hint, and BITNESS_DEFAULT means an empty string.

See also
setBitness

getBrandVersionList

Added in 1.9.0
fun getBrandVersionList(): (Mutable)List<UserAgentMetadata.BrandVersion!>

Returns the current list of user-agent brand versions which are used to populate user-agent client hints sec-ch-ua and sec-ch-ua-full-version-list. Each BrandVersion object holds the brand name, brand major version and brand full version.

getFullVersion

Added in 1.9.0
fun getFullVersion(): String?

Returns the value for the sec-ch-ua-full-version client hint.

See also
setFullVersion

getModel

Added in 1.9.0
fun getModel(): String?

Returns the value for the sec-ch-ua-model client hint.

See also
setModel

getPlatform

Added in 1.9.0
fun getPlatform(): String?

Returns the value for the sec-ch-ua-platform client hint.

See also
setPlatform

getPlatformVersion

Added in 1.9.0
fun getPlatformVersion(): String?

Returns the value for the sec-ch-ua-platform-version client hint.

Returns
String?

Platform version string.

hashCode

fun hashCode(): Int

isMobile

Added in 1.9.0
fun isMobile(): Boolean

Returns the value for the sec-ch-ua-mobile client hint.

Returns
Boolean

A boolean indicates user-agent's device mobileness.

See also
setMobile

isWow64

Added in 1.9.0
fun isWow64(): Boolean

Returns the value for the sec-ch-ua-wow64 client hint.

Returns
Boolean

A boolean to indicate whether user-agent's binary is running in 32-bit mode on 64-bit Windows.

See also
setWow64