Package org.htmlunit

Class 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 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
      • 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 the setAcceptLanguageHeader(String).
        Parameters:
        browserLanguage - the browserLanguage 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
      • 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 - the Accept-Encoding header
        Returns:
        this for fluent use
      • setAcceptLanguageHeader

        public BrowserVersion.BrowserVersionBuilder setAcceptLanguageHeader​(java.lang.String acceptLanguageHeader)
        Parameters:
        acceptLanguageHeader - the Accept-Language header
        Returns:
        this for fluent use
      • setHtmlAcceptHeader

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

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

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

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

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

        public BrowserVersion.BrowserVersionBuilder setSecClientHintUserAgentHeader​(java.lang.String secClientHintUserAgentHeader)
        Parameters:
        secClientHintUserAgentHeader - the sec-ch-ua header value
        Returns:
        this for fluent use
      • setSecClientHintUserAgentPlatformHeader

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