UserAgentMetadata
public final 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 |
|---|
public final class UserAgentMetadata.BrandVersionClass that holds brand name, major version and full version. |
public final class UserAgentMetadata.BrandVersion.BuilderBuilder used to create |
public final class UserAgentMetadata.BuilderBuilder used to create |
Constants |
|
|---|---|
static final int |
BITNESS_DEFAULT = 0Use this value for bitness to use the platform's default bitness value, which is an empty string for Android WebView. |
static final String |
FORM_FACTOR_AUTOMOTIVE = "Automotive"Form factor option: |
static final String |
FORM_FACTOR_DESKTOP = "Desktop"Form factor option: |
static final String |
FORM_FACTOR_EINK = "EInk"Form factor option: |
static final String |
FORM_FACTOR_MOBILE = "Mobile"Form factor option: |
static final String |
FORM_FACTOR_TABLET = "Tablet"Form factor option: |
static final String |
FORM_FACTOR_WATCH = "Watch"Form factor option: |
static final String |
FORM_FACTOR_XR = "XR"Form factor option: |
Public methods |
|
|---|---|
boolean |
Two UserAgentMetadata objects are equal only if all the metadata values are equal. |
@Nullable String |
Returns the value for the |
int |
Returns the value for the |
@NonNull List<UserAgentMetadata.BrandVersion> |
Returns the current list of user-agent brand versions which are used to populate user-agent client hints |
@NonNull List<String> |
Returns the value for the |
@Nullable String |
Returns the value for the |
@Nullable String |
getModel()Returns the value for the |
@Nullable String |
Returns the value for the |
@Nullable 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
public static final int BITNESS_DEFAULT = 0
Use this value for bitness to use the platform's default bitness value, which is an empty string for Android WebView.
FORM_FACTOR_AUTOMOTIVE
public static final String FORM_FACTOR_AUTOMOTIVE = "Automotive"
Form factor option: Automotive, to be used with setFormFactors and getFormFactors.
FORM_FACTOR_DESKTOP
public static final String FORM_FACTOR_DESKTOP = "Desktop"
Form factor option: Desktop, to be used with setFormFactors and getFormFactors.
FORM_FACTOR_EINK
public static final String FORM_FACTOR_EINK = "EInk"
Form factor option: EInk, to be used with setFormFactors and getFormFactors.
FORM_FACTOR_MOBILE
public static final String FORM_FACTOR_MOBILE = "Mobile"
Form factor option: Mobile, to be used with setFormFactors and getFormFactors.
FORM_FACTOR_TABLET
public static final String FORM_FACTOR_TABLET = "Tablet"
Form factor option: Tablet, to be used with setFormFactors and getFormFactors.
FORM_FACTOR_WATCH
public static final String FORM_FACTOR_WATCH = "Watch"
Form factor option: Watch, to be used with setFormFactors and getFormFactors.
FORM_FACTOR_XR
public static final String FORM_FACTOR_XR = "XR"
Form factor option: XR, to be used with setFormFactors and getFormFactors.
Public methods
equals
public boolean equals(Object o)
Two UserAgentMetadata objects are equal only if all the metadata values are equal.
getArchitecture
public @Nullable String getArchitecture()
Returns the value for the sec-ch-ua-arch client hint.
| See also | |
|---|---|
setArchitecture |
getBitness
public int getBitness()
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
public @NonNull List<UserAgentMetadata.BrandVersion> getBrandVersionList()
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
public @NonNull List<String> getFormFactors()
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
public @Nullable String getFullVersion()
Returns the value for the sec-ch-ua-full-version client hint.
| See also | |
|---|---|
setFullVersion |
getModel
public @Nullable String getModel()
Returns the value for the sec-ch-ua-model client hint.
| See also | |
|---|---|
setModel |
getPlatform
public @Nullable String getPlatform()
Returns the value for the sec-ch-ua-platform client hint.
| See also | |
|---|---|
setPlatform |
getPlatformVersion
public @Nullable String getPlatformVersion()
Returns the value for the sec-ch-ua-platform-version client hint.
| See also | |
|---|---|
setPlatformVersion |