Package org.htmlunit
Class BrowserVersion.BrowserVersionBuilder
- java.lang.Object
-
- org.htmlunit.BrowserVersion.BrowserVersionBuilder
-
- Enclosing class:
- BrowserVersion
public static class BrowserVersion.BrowserVersionBuilder extends java.lang.Object
Because BrowserVersion is immutable we need a builder for this complex object setup.
-
-
Constructor Summary
Constructors Constructor Description BrowserVersionBuilder(BrowserVersion version)
Creates a new BrowserVersionBuilder using the given browser version as template for the browser to be constructed.
-
Method Summary
-
-
-
Constructor Detail
-
BrowserVersionBuilder
public BrowserVersionBuilder(BrowserVersion version)
Creates a new BrowserVersionBuilder using the given browser version as template for the browser to be constructed.- Parameters:
version
- the blueprint
-
-
Method Detail
-
build
public BrowserVersion build()
- Returns:
- the new immutable browser version
-
setApplicationMinorVersion
public BrowserVersion.BrowserVersionBuilder setApplicationMinorVersion(java.lang.String applicationMinorVersion)
- Parameters:
applicationMinorVersion
- the applicationMinorVersion to set- Returns:
- this for fluent use
-
setApplicationName
public BrowserVersion.BrowserVersionBuilder setApplicationName(java.lang.String applicationName)
- Parameters:
applicationName
- the applicationName to set- Returns:
- this for fluent use
-
setApplicationVersion
public BrowserVersion.BrowserVersionBuilder setApplicationVersion(java.lang.String applicationVersion)
- Parameters:
applicationVersion
- the applicationVersion to set- Returns:
- this for fluent use
-
setVendor
public BrowserVersion.BrowserVersionBuilder setVendor(java.lang.String vendor)
- Parameters:
vendor
- the vendor to set- Returns:
- this for fluent use
-
setApplicationCodeName
public BrowserVersion.BrowserVersionBuilder setApplicationCodeName(java.lang.String applicationCodeName)
- Parameters:
applicationCodeName
- the applicationCodeName to set- Returns:
- this for fluent use
-
setBrowserLanguage
public BrowserVersion.BrowserVersionBuilder setBrowserLanguage(java.lang.String browserLanguage)
Changes the browser language property. This is used for various output formating. If you like change the language the browser requests from the server you have to adjust thesetAcceptLanguageHeader(String)
.- Parameters:
browserLanguage
- the browserLanguage to set- Returns:
- this for fluent use
-
setCpuClass
public BrowserVersion.BrowserVersionBuilder setCpuClass(java.lang.String cpuClass)
- Parameters:
cpuClass
- the cpuClass to set- Returns:
- this for fluent use
-
setOnLine
public BrowserVersion.BrowserVersionBuilder setOnLine(boolean onLine)
- Parameters:
onLine
- the onLine to set- Returns:
- this for fluent use
-
setPlatform
public BrowserVersion.BrowserVersionBuilder setPlatform(java.lang.String platform)
- Parameters:
platform
- the platform to set- Returns:
- this for fluent use
-
setSystemLanguage
public BrowserVersion.BrowserVersionBuilder setSystemLanguage(java.lang.String systemLanguage)
- Parameters:
systemLanguage
- the systemLanguage to set- Returns:
- this for fluent use
-
setSystemTimezone
public BrowserVersion.BrowserVersionBuilder setSystemTimezone(java.util.TimeZone systemTimezone)
- Parameters:
systemTimezone
- the systemTimezone to set- Returns:
- this for fluent use
-
setUserAgent
public BrowserVersion.BrowserVersionBuilder setUserAgent(java.lang.String userAgent)
- Parameters:
userAgent
- the userAgent to set- Returns:
- this for fluent use
-
setUserLanguage
public BrowserVersion.BrowserVersionBuilder setUserLanguage(java.lang.String userLanguage)
- Parameters:
userLanguage
- the userLanguage to set- Returns:
- this for fluent use
-
setAcceptEncodingHeader
public BrowserVersion.BrowserVersionBuilder setAcceptEncodingHeader(java.lang.String acceptEncodingHeader)
- Parameters:
acceptEncodingHeader
- theAccept-Encoding
header- Returns:
- this for fluent use
-
setAcceptLanguageHeader
public BrowserVersion.BrowserVersionBuilder setAcceptLanguageHeader(java.lang.String acceptLanguageHeader)
- Parameters:
acceptLanguageHeader
- theAccept-Language
header- Returns:
- this for fluent use
-
setHtmlAcceptHeader
public BrowserVersion.BrowserVersionBuilder setHtmlAcceptHeader(java.lang.String htmlAcceptHeader)
- Parameters:
htmlAcceptHeader
- theAccept
header to be used when retrieving pages- Returns:
- this for fluent use
-
setImgAcceptHeader
public BrowserVersion.BrowserVersionBuilder setImgAcceptHeader(java.lang.String imgAcceptHeader)
- Parameters:
imgAcceptHeader
- theAccept
header to be used when retrieving images- Returns:
- this for fluent use
-
setCssAcceptHeader
public BrowserVersion.BrowserVersionBuilder setCssAcceptHeader(java.lang.String cssAcceptHeader)
- Parameters:
cssAcceptHeader
- theAccept
header to be used when retrieving pages- Returns:
- this for fluent use
-
setScriptAcceptHeader
public BrowserVersion.BrowserVersionBuilder setScriptAcceptHeader(java.lang.String scriptAcceptHeader)
- Parameters:
scriptAcceptHeader
- theAccept
header to be used when retrieving scripts- Returns:
- this for fluent use
-
setXmlHttpRequestAcceptHeader
public BrowserVersion.BrowserVersionBuilder setXmlHttpRequestAcceptHeader(java.lang.String xmlHttpRequestAcceptHeader)
- Parameters:
xmlHttpRequestAcceptHeader
- theAccept
header to be used when performing XMLHttpRequests- Returns:
- this for fluent use
-
setSecClientHintUserAgentHeader
public BrowserVersion.BrowserVersionBuilder setSecClientHintUserAgentHeader(java.lang.String secClientHintUserAgentHeader)
- Parameters:
secClientHintUserAgentHeader
- thesec-ch-ua
header value- Returns:
- this for fluent use
-
setSecClientHintUserAgentPlatformHeader
public BrowserVersion.BrowserVersionBuilder setSecClientHintUserAgentPlatformHeader(java.lang.String secClientHintUserAgentPlatformHeader)
- Parameters:
secClientHintUserAgentPlatformHeader
- thesec-ch-ua-platform
header value- Returns:
- this for fluent use
-
-