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 |
|
Builder used to create |
Constants |
|
|---|---|
const Int |
BITNESS_DEFAULT = 0Use this value for bitness to use the platform's default bitness value, which is an empty string for Android WebView. |
const String! |
FORM_FACTOR_AUTOMOTIVE = "Automotive"Form factor option: |
const String! |
FORM_FACTOR_DESKTOP = "Desktop"Form factor option: |
const String! |
FORM_FACTOR_EINK = "EInk"Form factor option: |
const String! |
FORM_FACTOR_MOBILE = "Mobile"Form factor option: |
const String! |
FORM_FACTOR_TABLET = "Tablet"Form factor option: |
const String! |
FORM_FACTOR_WATCH = "Watch"Form factor option: |
const String! |
FORM_FACTOR_XR = "XR"Form factor option: |
Public functions |
|
|---|---|
Boolean |
Two UserAgentMetadata objects are equal only if all the metadata values are equal. |
String? |
Returns the value for the |
Int |
Returns the value for the |
(Mutable)List<UserAgentMetadata.BrandVersion!> |
Returns the current list of user-agent brand versions which are used to populate user-agent client hints |
(Mutable)List<String!> |
Returns the value for the |
String? |
Returns the value for the |
String? |
getModel()Returns the value for the |
String? |
Returns the value for the |
String? |
Returns the value for the |
Int |
hashCode() |
Boolean |
isMobile()Returns the value for the |
Boolean |
isWow64()Returns the value for the |
Constants
BITNESS_DEFAULT
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.
FORM_FACTOR_AUTOMOTIVE
const val FORM_FACTOR_AUTOMOTIVE = "Automotive": String!
Form factor option: Automotive, to be used with setFormFactors and getFormFactors.
FORM_FACTOR_DESKTOP
const val FORM_FACTOR_DESKTOP = "Desktop": String!
Form factor option: Desktop, to be used with setFormFactors and getFormFactors.
FORM_FACTOR_EINK
const val FORM_FACTOR_EINK = "EInk": String!
Form factor option: EInk, to be used with setFormFactors and getFormFactors.
FORM_FACTOR_MOBILE
const val FORM_FACTOR_MOBILE = "Mobile": String!
Form factor option: Mobile, to be used with setFormFactors and getFormFactors.
FORM_FACTOR_TABLET
const val FORM_FACTOR_TABLET = "Tablet": String!
Form factor option: Tablet, to be used with setFormFactors and getFormFactors.
FORM_FACTOR_WATCH
const val FORM_FACTOR_WATCH = "Watch": String!
Form factor option: Watch, to be used with setFormFactors and getFormFactors.
FORM_FACTOR_XR
const val FORM_FACTOR_XR = "XR": String!
Form factor option: XR, to be used with setFormFactors and getFormFactors.
Public functions
equals
fun equals(o: Any!): Boolean
Two UserAgentMetadata objects are equal only if all the metadata values are equal.
getArchitecture
fun getArchitecture(): String?
Returns the value for the sec-ch-ua-arch client hint.
| See also | |
|---|---|
setArchitecture |
getBitness
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 |
| See also | |
|---|---|
setBitness |
getBrandVersionList
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.
| See also | |
|---|---|
setBrandVersionList |
getFormFactors
fun getFormFactors(): (Mutable)List<String!>
Returns the value for the sec-ch-ua-form-factors client hint. Value should be one or more of FORM_FACTOR_DESKTOP, FORM_FACTOR_AUTOMOTIVE, FORM_FACTOR_MOBILE, FORM_FACTOR_TABLET, FORM_FACTOR_XR, FORM_FACTOR_EINK, FORM_FACTOR_WATCH. See the spec for more details.
| See also | |
|---|---|
setFormFactors |
getFullVersion
fun getFullVersion(): String?
Returns the value for the sec-ch-ua-full-version client hint.
| See also | |
|---|---|
setFullVersion |
getModel
fun getModel(): String?
Returns the value for the sec-ch-ua-model client hint.
| See also | |
|---|---|
setModel |
getPlatform
fun getPlatform(): String?
Returns the value for the sec-ch-ua-platform client hint.
| See also | |
|---|---|
setPlatform |
getPlatformVersion
fun getPlatformVersion(): String?
Returns the value for the sec-ch-ua-platform-version client hint.
| Returns | |
|---|---|
String? |
Platform version string. |
| See also | |
|---|---|
setPlatformVersion |