Class DefaultWebUserAgentProduct

All Implemented Interfaces:
BrandedProduct<WebUserAgentProduct.Brand>, ClientProduct, Product, WebUserAgentProduct

public class DefaultWebUserAgentProduct extends AbstractBrandedProduct<WebUserAgentProduct.Brand> implements WebUserAgentProduct
The default implementation of the identification of the user agent client, such as a browser, accessing Guise on the web platform.
Author:
Garret Wilson
  • Constructor Details

    • DefaultWebUserAgentProduct

      public DefaultWebUserAgentProduct(String id, WebUserAgentProduct.Brand brand, String name, String version, double versionNumber, int[] versionNumbers, Iterable<com.globalmentor.net.MediaType> acceptedContentTypes, Iterable<Locale> acceptedLanguages)
      ID, brand, name, and version constructor.
      Parameters:
      id - The identifying string of the product, or null if the ID is not known.
      brand - The brand of the product, or null if the brand is not known.
      name - The canonical name of the product, or null if the name is not known.
      version - The version string provided by the product, or null if there is no string version of the product.
      versionNumber - The version number provided by the product, or Double.NaN if there is no version number of the product.
      versionNumbers - The version number components provided by the product, or null if there are no version number components of the product.
      acceptedContentTypes - The content types accepted by the client.
      acceptedLanguages - The languages accepted by the client.
      Throws:
      NullPointerException - if the given ID, name, accepted content types, and/or accepted languages is null.
  • Method Details

    • getAcceptedContentTypes

      public Iterable<com.globalmentor.net.MediaType> getAcceptedContentTypes()
      Specified by:
      getAcceptedContentTypes in interface ClientProduct
      Returns:
      The content types accepted by the client.
    • isAcceptedContentType

      public boolean isAcceptedContentType(com.globalmentor.net.MediaType contentType)
      Description copied from interface: ClientProduct
      Determines if the client accepts the given content type. Wildcard content types are correctly matched.
      Specified by:
      isAcceptedContentType in interface ClientProduct
      Parameters:
      contentType - The content type to check.
      Returns:
      true if the client accepts the given content type.
    • isAcceptedContentType

      public boolean isAcceptedContentType(com.globalmentor.net.MediaType contentType, boolean matchWildcards)
      Description copied from interface: ClientProduct
      Determines if the client accepts the given content type.
      Specified by:
      isAcceptedContentType in interface ClientProduct
      Parameters:
      contentType - The content type to check.
      matchWildcards - true if the content type should be matched against wildcard sequences, as is normal.
      Returns:
      true if the client accepts the given content type.
    • getClientAcceptedLanguages

      public Iterable<Locale> getClientAcceptedLanguages()
      Specified by:
      getClientAcceptedLanguages in interface ClientProduct
      Returns:
      The languages accepted by the client.