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
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<com.globalmentor.net.ContentType>
getAcceptedContentTypes()
java.lang.Iterable<java.util.Locale>
getClientAcceptedLanguages()
boolean
isAcceptedContentType(com.globalmentor.net.ContentType contentType)
Determines if the client accepts the given content type.boolean
isAcceptedContentType(com.globalmentor.net.ContentType 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 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, 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:
java.lang.NullPointerException
- if the given ID, name, accepted content types, and/or accepted languages isnull
.
-
-
Method Detail
-
getAcceptedContentTypes
public java.lang.Iterable<com.globalmentor.net.ContentType> getAcceptedContentTypes()
- Specified by:
getAcceptedContentTypes
in interfaceClientProduct
- 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 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.ContentType 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
public java.lang.Iterable<java.util.Locale> getClientAcceptedLanguages()
- Specified by:
getClientAcceptedLanguages
in interfaceClientProduct
- Returns:
- The languages accepted by the client.
-
-