Class UserAgentContext

    • Field Detail

      • address

        @Nullable
        private InetAddress address
        Address of the user-agent host.
      • identifier

        @Nullable
        private String identifier
        An identification string (such as a User-Agent header).
      • userAgent

        @Nullable
        private eu.bitwalker.useragentutils.UserAgent userAgent
        Parsed User-Agent.
    • Constructor Detail

      • UserAgentContext

        public UserAgentContext()
    • Method Detail

      • getAddress

        @Nullable
        public InetAddress getAddress()
        Get the address of the user-agent host.
        Returns:
        address of the user-agent host
      • setAddress

        @Nonnull
        public UserAgentContext setAddress​(@Nullable
                                           InetAddress userAgentAddress)
        Set the address of the user-agent host.
        Parameters:
        userAgentAddress - address of the user-agent host
        Returns:
        this context
      • getIdentifier

        @Nullable
        public String getIdentifier()
        Get the user agent identifier.
        Returns:
        identifier for the user agent
      • setIdentifier

        @Nonnull
        public UserAgentContext setIdentifier​(@Nullable
                                              String id)
        Set the user agent identifier. The parsed user agent is available via getUserAgent() upon calling this method.
        Parameters:
        id - identifier for the user agent
        Returns:
        this context
      • getUserAgent

        @Deprecated(since="4.3.0",
                    forRemoval=true)
        @Nullable
        public eu.bitwalker.useragentutils.UserAgent getUserAgent()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Gets the parsed user agent.
        Returns:
        Parsed user agent or null if setIdentifier(String) has not been called
      • isInstance

        @Deprecated(since="4.3.0",
                    forRemoval=true)
        public boolean isInstance​(@Nonnull
                                  eu.bitwalker.useragentutils.Browser browser)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Determines whether this user agent is an instance of the given browser.
        Parameters:
        browser - browser to check
        Returns:
        True if this user agent is an instance of the given browser, false otherwise
      • isInstance

        @Deprecated(since="4.3.0",
                    forRemoval=true)
        public boolean isInstance​(@Nonnull
                                  eu.bitwalker.useragentutils.OperatingSystem os)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Determines whether this user agent is an instance of the given operating system.
        Parameters:
        os - operating system to check
        Returns:
        True if this user agent is an instance of the given operating system, false otherwise