code: @Nonnull
    public static IUserAgent getUserAgent (@Nonnull final HttpServletRequest aHttpRequest)
    {
      IUserAgent aUserAgent = (IUserAgent) aHttpRequest.getAttribute (IUserAgent.class.getName ());
      if (aUserAgent == null)
      {
        // Extract HTTP header from request
        final String sUserAgent = getHttpUserAgentStringFromRequest (aHttpRequest);
        aUserAgent = UserAgentDatabase.getParsedUserAgent (sUserAgent);
        if (aUserAgent == null)
        {
          LOGGER.warn ("No user agent was passed in the request!");
          aUserAgent = new UserAgent ("", new UserAgentElementList ());
        }
        ServletHelper.setRequestAttribute (aHttpRequest, IUserAgent.class.getName (), aUserAgent);
      }
      return aUserAgent;
    }
docs: Get the user agent object from the given HTTP request.
  
  @param aHttpRequest
  The HTTP request to extract the information from.
  @return A non-<code>null</code> user agent object.