Package org.htmlunit

# Class BrowserVersion.BrowserVersionBuilder

java.lang.Object
org.htmlunit.BrowserVersion.BrowserVersionBuilder

Enclosing class:
  `BrowserVersion`

public static class BrowserVersion.BrowserVersionBuilder extends 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

  Modifier and Type
  Method
  Description
  `BrowserVersion`
  `build()`
  `BrowserVersion.BrowserVersionBuilder`
  `setAcceptEncodingHeader(String acceptEncodingHeader)`
  `BrowserVersion.BrowserVersionBuilder`
  `setAcceptLanguageHeader(String acceptLanguageHeader)`
  `BrowserVersion.BrowserVersionBuilder`
  `setApplicationCodeName(String applicationCodeName)`
  `BrowserVersion.BrowserVersionBuilder`
  `setApplicationMinorVersion(String applicationMinorVersion)`
  `BrowserVersion.BrowserVersionBuilder`
  `setApplicationName(String applicationName)`
  `BrowserVersion.BrowserVersionBuilder`
  `setApplicationVersion(String applicationVersion)`
  `BrowserVersion.BrowserVersionBuilder`
  `setBrowserLanguage(String browserLanguage)`
  Changes the browser language property.
  `BrowserVersion.BrowserVersionBuilder`
  `setCssAcceptHeader(String cssAcceptHeader)`
  `BrowserVersion.BrowserVersionBuilder`
  `setHtmlAcceptHeader(String htmlAcceptHeader)`
  `BrowserVersion.BrowserVersionBuilder`
  `setImgAcceptHeader(String imgAcceptHeader)`
  `BrowserVersion.BrowserVersionBuilder`
  `setOnLine(boolean onLine)`
  `BrowserVersion.BrowserVersionBuilder`
  `setPlatform(String platform)`
  `BrowserVersion.BrowserVersionBuilder`
  `setScriptAcceptHeader(String scriptAcceptHeader)`
  `BrowserVersion.BrowserVersionBuilder`
  `setSecClientHintUserAgentHeader(String secClientHintUserAgentHeader)`
  `BrowserVersion.BrowserVersionBuilder`
  `setSecClientHintUserAgentPlatformHeader(String secClientHintUserAgentPlatformHeader)`
  `BrowserVersion.BrowserVersionBuilder`
  `setSystemTimezone(TimeZone systemTimezone)`
  `BrowserVersion.BrowserVersionBuilder`
  `setUserAgent(String userAgent)`
  `BrowserVersion.BrowserVersionBuilder`
  `setVendor(String vendor)`
  `BrowserVersion.BrowserVersionBuilder`
  `setXmlHttpRequestAcceptHeader(String xmlHttpRequestAcceptHeader)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### 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 Details

  - ### build

    public BrowserVersion build()
    Returns:
      the new immutable browser version

  - ### setApplicationMinorVersion

    public BrowserVersion.BrowserVersionBuilder setApplicationMinorVersion(String applicationMinorVersion)
    Parameters:
      `applicationMinorVersion` - the applicationMinorVersion to set
    Returns:
      this for fluent use

  - ### setApplicationName

    public BrowserVersion.BrowserVersionBuilder setApplicationName(String applicationName)
    Parameters:
      `applicationName` - the applicationName to set
    Returns:
      this for fluent use

  - ### setApplicationVersion

    public BrowserVersion.BrowserVersionBuilder setApplicationVersion(String applicationVersion)
    Parameters:
      `applicationVersion` - the applicationVersion to set
    Returns:
      this for fluent use

  - ### setVendor

    public BrowserVersion.BrowserVersionBuilder setVendor(String vendor)
    Parameters:
      `vendor` - the vendor to set
    Returns:
      this for fluent use

  - ### setApplicationCodeName

    public BrowserVersion.BrowserVersionBuilder setApplicationCodeName(String applicationCodeName)
    Parameters:
      `applicationCodeName` - the applicationCodeName to set
    Returns:
      this for fluent use

  - ### setBrowserLanguage

    public BrowserVersion.BrowserVersionBuilder setBrowserLanguage(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 the `setAcceptLanguageHeader(String)`.
    Parameters:
      `browserLanguage` - the browserLanguage 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(String platform)
    Parameters:
      `platform` - the platform to set
    Returns:
      this for fluent use

  - ### setSystemTimezone

    public BrowserVersion.BrowserVersionBuilder setSystemTimezone(TimeZone systemTimezone)
    Parameters:
      `systemTimezone` - the systemTimezone to set
    Returns:
      this for fluent use

  - ### setUserAgent

    public BrowserVersion.BrowserVersionBuilder setUserAgent(String userAgent)
    Parameters:
      `userAgent` - the userAgent to set
    Returns:
      this for fluent use

  - ### setAcceptEncodingHeader

    public BrowserVersion.BrowserVersionBuilder setAcceptEncodingHeader(String acceptEncodingHeader)
    Parameters:
      `acceptEncodingHeader` - the `Accept-Encoding` header
    Returns:
      this for fluent use

  - ### setAcceptLanguageHeader

    public BrowserVersion.BrowserVersionBuilder setAcceptLanguageHeader(String acceptLanguageHeader)
    Parameters:
      `acceptLanguageHeader` - the `Accept-Language` header
    Returns:
      this for fluent use

  - ### setHtmlAcceptHeader

    public BrowserVersion.BrowserVersionBuilder setHtmlAcceptHeader(String htmlAcceptHeader)
    Parameters:
      `htmlAcceptHeader` - the `Accept` header to be used when retrieving pages
    Returns:
      this for fluent use

  - ### setImgAcceptHeader

    public BrowserVersion.BrowserVersionBuilder setImgAcceptHeader(String imgAcceptHeader)
    Parameters:
      `imgAcceptHeader` - the `Accept` header to be used when retrieving images
    Returns:
      this for fluent use

  - ### setCssAcceptHeader

    public BrowserVersion.BrowserVersionBuilder setCssAcceptHeader(String cssAcceptHeader)
    Parameters:
      `cssAcceptHeader` - the `Accept` header to be used when retrieving pages
    Returns:
      this for fluent use

  - ### setScriptAcceptHeader

    public BrowserVersion.BrowserVersionBuilder setScriptAcceptHeader(String scriptAcceptHeader)
    Parameters:
      `scriptAcceptHeader` - the `Accept` header to be used when retrieving scripts
    Returns:
      this for fluent use

  - ### setXmlHttpRequestAcceptHeader

    public BrowserVersion.BrowserVersionBuilder setXmlHttpRequestAcceptHeader(String xmlHttpRequestAcceptHeader)
    Parameters:
      `xmlHttpRequestAcceptHeader` - the `Accept` header to be used when performing XMLHttpRequests
    Returns:
      this for fluent use

  - ### setSecClientHintUserAgentHeader

    public BrowserVersion.BrowserVersionBuilder setSecClientHintUserAgentHeader(String secClientHintUserAgentHeader)
    Parameters:
      `secClientHintUserAgentHeader` - the `sec-ch-ua` header value
    Returns:
      this for fluent use

  - ### setSecClientHintUserAgentPlatformHeader

    public BrowserVersion.BrowserVersionBuilder setSecClientHintUserAgentPlatformHeader(String secClientHintUserAgentPlatformHeader)
    Parameters:
      `secClientHintUserAgentPlatformHeader` - the `sec-ch-ua-platform` header value
    Returns:
      this for fluent use