java.lang.Object
org.htmlunit.BrowserVersion.BrowserVersionBuilder
- Enclosing class:
- BrowserVersion
Because BrowserVersion is immutable we need a builder
for this complex object setup.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Performs this operation.setAcceptEncodingHeader(String acceptEncodingHeader) Sets the accept encoding header.setAcceptLanguageHeader(String acceptLanguageHeader) Sets the accept language header.setApplicationCodeName(String applicationCodeName) Sets the application code name.setApplicationMinorVersion(String applicationMinorVersion) Sets the application minor version.setApplicationName(String applicationName) Sets the application name.setApplicationVersion(String applicationVersion) Sets the application version.setBrowserLanguage(String browserLanguage) Changes the browser language property.setCssAcceptHeader(String cssAcceptHeader) Sets the css accept header.setHtmlAcceptHeader(String htmlAcceptHeader) Sets the html accept header.setImgAcceptHeader(String imgAcceptHeader) Sets the img accept header.setOnLine(boolean onLine) Sets the on line.setPlatform(String platform) Sets the platform.setScriptAcceptHeader(String scriptAcceptHeader) Sets the script accept header.setSecClientHintUserAgentHeader(String secClientHintUserAgentHeader) Sets the sec client hint user agent header.setSecClientHintUserAgentPlatformHeader(String secClientHintUserAgentPlatformHeader) Sets the sec client hint user agent platform header.setSystemTimezone(TimeZone systemTimezone) Sets the system timezone.setUserAgent(String userAgent) Sets the user agent.Sets the vendor.setXmlHttpRequestAcceptHeader(String xmlHttpRequestAcceptHeader) Sets the xml http request accept header.
-
Constructor Details
-
BrowserVersionBuilder
Performs this operation. Creates a new BrowserVersionBuilder using the given browser version as template for the browser to be constructed.- Parameters:
version- the blueprint
-
-
Method Details
-
build
Performs this operation.- Returns:
- the new immutable browser version
-
setApplicationMinorVersion
public BrowserVersion.BrowserVersionBuilder setApplicationMinorVersion(String applicationMinorVersion) Sets the application minor version.- Parameters:
applicationMinorVersion- the applicationMinorVersion to set- Returns:
- this for fluent use
-
setApplicationName
Sets the application name.- Parameters:
applicationName- the applicationName to set- Returns:
- this for fluent use
-
setApplicationVersion
Sets the application version.- Parameters:
applicationVersion- the applicationVersion to set- Returns:
- this for fluent use
-
setVendor
Sets the vendor.- Parameters:
vendor- the vendor to set- Returns:
- this for fluent use
-
setApplicationCodeName
Sets the application code name.- Parameters:
applicationCodeName- the applicationCodeName to set- Returns:
- this for fluent use
-
setBrowserLanguage
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
-
setOnLine
Sets the on line.- Parameters:
onLine- the onLine to set- Returns:
- this for fluent use
-
setPlatform
Sets the platform.- Parameters:
platform- the platform to set- Returns:
- this for fluent use
-
setSystemTimezone
Sets the system timezone.- Parameters:
systemTimezone- the systemTimezone to set- Returns:
- this for fluent use
-
setUserAgent
Sets the user agent.- Parameters:
userAgent- the userAgent to set- Returns:
- this for fluent use
-
setAcceptEncodingHeader
Sets the accept encoding header.- Parameters:
acceptEncodingHeader- theAccept-Encodingheader- Returns:
- this for fluent use
-
setAcceptLanguageHeader
Sets the accept language header.- Parameters:
acceptLanguageHeader- theAccept-Languageheader- Returns:
- this for fluent use
-
setHtmlAcceptHeader
Sets the html accept header.- Parameters:
htmlAcceptHeader- theAcceptheader to be used when retrieving pages- Returns:
- this for fluent use
-
setImgAcceptHeader
Sets the img accept header.- Parameters:
imgAcceptHeader- theAcceptheader to be used when retrieving images- Returns:
- this for fluent use
-
setCssAcceptHeader
Sets the css accept header.- Parameters:
cssAcceptHeader- theAcceptheader to be used when retrieving pages- Returns:
- this for fluent use
-
setScriptAcceptHeader
Sets the script accept header.- Parameters:
scriptAcceptHeader- theAcceptheader to be used when retrieving scripts- Returns:
- this for fluent use
-
setXmlHttpRequestAcceptHeader
public BrowserVersion.BrowserVersionBuilder setXmlHttpRequestAcceptHeader(String xmlHttpRequestAcceptHeader) Sets the xml http request accept header.- Parameters:
xmlHttpRequestAcceptHeader- theAcceptheader to be used when performing XMLHttpRequests- Returns:
- this for fluent use
-
setSecClientHintUserAgentHeader
public BrowserVersion.BrowserVersionBuilder setSecClientHintUserAgentHeader(String secClientHintUserAgentHeader) Sets the sec client hint user agent header.- Parameters:
secClientHintUserAgentHeader- thesec-ch-uaheader value- Returns:
- this for fluent use
-
setSecClientHintUserAgentPlatformHeader
public BrowserVersion.BrowserVersionBuilder setSecClientHintUserAgentPlatformHeader(String secClientHintUserAgentPlatformHeader) Sets the sec client hint user agent platform header.- Parameters:
secClientHintUserAgentPlatformHeader- thesec-ch-ua-platformheader value- Returns:
- this for fluent use
-