Package com.teamdev.jxbrowser.net
Class UserAgentData.Builder
java.lang.Object
com.teamdev.jxbrowser.net.UserAgentData.Builder
- Enclosing interface:
- UserAgentData
A builder of
UserAgentData.
Builders are created by invoking UserAgentData.newBuilder().
Each of the setter methods modifies the state of the builder and returns the same instance. Builders are not thread-safe and should not be used concurrently from multiple threads without external synchronization.
-
Method Summary
Modifier and TypeMethodDescriptionaddBrand(UserAgentBrand brand) Adds the brand of the user-agent.addFormFactor(String formFactor) Adds the form factor associated with the device of the user agent.architecture(String architecture) Sets the architecture of the platform on which a given user agent is executing (e.g.Sets the bitness of the architecture of the platform on which a given user agent is executing (e.g.build()Returns a newUserAgentDatainstance built from the current state of this builder.fullVersion(String fullVersion) Sets the full version of the user-agent (e.g.mobile(boolean mobile) Sets whether the user agent is running on a mobile device (e.g.Sets the model of the device on which a given user agent is executing.Sets the platform on which a given user agent is executing (e.g.platformVersion(String platformVersion) Sets the platform version on which a given user agent is executing.wow64(boolean wow64) Sets whether the user agent binary is running in 32-bit mode on 64-bit Windows.
-
Method Details
-
addBrand
Adds the brand of the user-agent. -
addFormFactor
Adds the form factor associated with the device of the user agent.- Throws:
IllegalArgumentException- if the form factor is empty or blank
-
fullVersion
Sets the full version of the user-agent (e.g. "133.0.4472.124").- Throws:
IllegalArgumentException- if the full version is empty or blank
-
platform
Sets the platform on which a given user agent is executing (e.g. "Windows", "macOS", "Linux", "Android").- Throws:
IllegalArgumentException- if the platform is empty or blank
-
platformVersion
Sets the platform version on which a given user agent is executing.- Throws:
IllegalArgumentException- if the platform version is empty or blank
-
architecture
Sets the architecture of the platform on which a given user agent is executing (e.g. "x86", "x86_64", "ARM").- Throws:
IllegalArgumentException- if the architecture is empty or blank
-
bitness
Sets the bitness of the architecture of the platform on which a given user agent is executing (e.g. "32", "64").- Throws:
IllegalArgumentException- if the bitness is empty or blank
-
model
Sets the model of the device on which a given user agent is executing.- Throws:
IllegalArgumentException- if the model is empty or blank
-
mobile
Sets whether the user agent is running on a mobile device (e.g. a smartphone or tablet). -
wow64
Sets whether the user agent binary is running in 32-bit mode on 64-bit Windows. -
build
Returns a newUserAgentDatainstance built from the current state of this builder.
-