Package io.guise.framework.platform.web
Class DefaultWebUserAgentProduct
java.lang.Object
io.guise.framework.platform.AbstractProduct
io.guise.framework.platform.AbstractBrandedProduct<WebUserAgentProduct.Brand>
io.guise.framework.platform.web.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
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.guise.framework.platform.BrandedProduct
BrandedProduct.Brand
Nested classes/interfaces inherited from interface io.guise.framework.platform.web.WebUserAgentProduct
WebUserAgentProduct.Brand
-
Constructor Summary
ConstructorDescriptionDefaultWebUserAgentProduct
(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. -
Method Summary
Modifier and TypeMethodDescriptionIterable<com.globalmentor.net.MediaType>
boolean
isAcceptedContentType
(com.globalmentor.net.MediaType contentType) Determines if the client accepts the given content type.boolean
isAcceptedContentType
(com.globalmentor.net.MediaType contentType, boolean matchWildcards) Determines if the client accepts the given content type.Methods inherited from class io.guise.framework.platform.AbstractBrandedProduct
getBrand, isBrandLessThanVersionNumber, isBrandVersionNumber
Methods inherited from class io.guise.framework.platform.AbstractProduct
getID, getName, getVersion, getVersionNumber, getVersionNumbers
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.guise.framework.platform.BrandedProduct
getBrand, isBrandLessThanVersionNumber, isBrandVersionNumber
Methods inherited from interface io.guise.framework.platform.Product
getID, getName, getVersion, getVersionNumber, getVersionNumbers
-
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, ornull
if the ID is not known.brand
- The brand of the product, ornull
if the brand is not known.name
- The canonical name of the product, ornull
if the name is not known.version
- The version string provided by the product, ornull
if there is no string version of the product.versionNumber
- The version number provided by the product, orDouble.NaN
if there is no version number of the product.versionNumbers
- The version number components provided by the product, ornull
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 isnull
.
-
-
Method Details
-
getAcceptedContentTypes
- Specified by:
getAcceptedContentTypes
in interfaceClientProduct
- 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 interfaceClientProduct
- 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 interfaceClientProduct
- 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
- Specified by:
getClientAcceptedLanguages
in interfaceClientProduct
- Returns:
- The languages accepted by the client.
-