Class DefaultWebUserAgentProduct

    • Constructor Detail

      • DefaultWebUserAgentProduct

        public DefaultWebUserAgentProduct​(java.lang.String id,
                                          WebUserAgentProduct.Brand brand,
                                          java.lang.String name,
                                          java.lang.String version,
                                          double versionNumber,
                                          int[] versionNumbers,
                                          java.lang.Iterable<com.globalmentor.net.ContentType> acceptedContentTypes,
                                          java.lang.Iterable<java.util.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:
        java.lang.NullPointerException - if the given ID, name, accepted content types, and/or accepted languages is null.
    • Method Detail

      • getAcceptedContentTypes

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

        public boolean isAcceptedContentType​(com.globalmentor.net.ContentType 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.ContentType 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 java.lang.Iterable<java.util.Locale> getClientAcceptedLanguages()
        Specified by:
        getClientAcceptedLanguages in interface ClientProduct
        Returns:
        The languages accepted by the client.