net.sf.uadetector
Class UserAgent

java.lang.Object
  extended by net.sf.uadetector.UserAgent
All Implemented Interfaces:
java.io.Serializable, ReadableUserAgent

public final class UserAgent
extends java.lang.Object
implements ReadableUserAgent, java.io.Serializable

UserAgent is an immutable entity that represents the informations about web-based client applications like Web browsers, search engines or crawlers (spiders) as well as mobile phones, screen readers and braille browsers.

Author:
André Rouél
See Also:
Serialized Form

Nested Class Summary
static class UserAgent.Builder
           
 
Field Summary
static UserAgent EMPTY
           
 
Constructor Summary
UserAgent(DeviceCategory deviceType, UserAgentFamily family, java.lang.String icon, java.lang.String name, OperatingSystem operatingSystem, java.lang.String producer, java.lang.String producerUrl, UserAgentType type, java.lang.String typeName, java.lang.String url, VersionNumber versionNumber)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 DeviceCategory getDeviceCategory()
          Gets the detected device category.
 UserAgentFamily getFamily()
          Gets the family of an user agent.
 java.lang.String getIcon()
          Gets the icon name of an user agent.
 java.lang.String getName()
          Gets the name of an user agent.
 OperatingSystem getOperatingSystem()
          Gets the operating system on which the user agent is running.
 java.lang.String getProducer()
          Returns the manufacturer of an user agent.
 java.lang.String getProducerUrl()
          Returns the URL to the main website of the manufacturer of an user agent.
 UserAgentType getType()
          Returns the type of an user agent, for example, mobile browser or email client.
 java.lang.String getTypeName()
          Returns the type name of an user agent, for example, mobile browser or email client.
 java.lang.String getUrl()
          Returns the URL to the product or information page of an user agent.
 VersionNumber getVersionNumber()
          Gets the version number of an user agent.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final UserAgent EMPTY
Constructor Detail

UserAgent

public UserAgent(@Nonnull
                 DeviceCategory deviceType,
                 @Nonnull
                 UserAgentFamily family,
                 @Nonnull
                 java.lang.String icon,
                 @Nonnull
                 java.lang.String name,
                 @Nonnull
                 OperatingSystem operatingSystem,
                 @Nonnull
                 java.lang.String producer,
                 @Nonnull
                 java.lang.String producerUrl,
                 @Nonnull
                 UserAgentType type,
                 @Nonnull
                 java.lang.String typeName,
                 @Nonnull
                 java.lang.String url,
                 @Nonnull
                 VersionNumber versionNumber)
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getDeviceCategory

@Nonnull
public DeviceCategory getDeviceCategory()
Description copied from interface: ReadableUserAgent
Gets the detected device category.

Specified by:
getDeviceCategory in interface ReadableUserAgent
Returns:
detected device category

getFamily

public UserAgentFamily getFamily()
Description copied from interface: ReadableUserAgent
Gets the family of an user agent.

Specified by:
getFamily in interface ReadableUserAgent
Returns:
family of an user agent

getIcon

public java.lang.String getIcon()
Description copied from interface: ReadableUserAgent
Gets the icon name of an user agent.

Specified by:
getIcon in interface ReadableUserAgent
Returns:
icon name of an user agent

getName

public java.lang.String getName()
Description copied from interface: ReadableUserAgent
Gets the name of an user agent.

Specified by:
getName in interface ReadableUserAgent
Returns:
name of an user agent

getOperatingSystem

public OperatingSystem getOperatingSystem()
Description copied from interface: ReadableUserAgent
Gets the operating system on which the user agent is running.

Specified by:
getOperatingSystem in interface ReadableUserAgent
Returns:
the running operating system

getProducer

public java.lang.String getProducer()
Description copied from interface: ReadableUserAgent
Returns the manufacturer of an user agent.

Specified by:
getProducer in interface ReadableUserAgent
Returns:
the manufacturer

getProducerUrl

public java.lang.String getProducerUrl()
Description copied from interface: ReadableUserAgent
Returns the URL to the main website of the manufacturer of an user agent.

Specified by:
getProducerUrl in interface ReadableUserAgent
Returns:
URL to the website of the manufacturer

getType

public UserAgentType getType()
Description copied from interface: ReadableUserAgent
Returns the type of an user agent, for example, mobile browser or email client.

Specified by:
getType in interface ReadableUserAgent
Returns:
the type of an user agent

getTypeName

public java.lang.String getTypeName()
Description copied from interface: ReadableUserAgent
Returns the type name of an user agent, for example, mobile browser or email client.

Specified by:
getTypeName in interface ReadableUserAgent
Returns:
the type name of an user agent

getUrl

public java.lang.String getUrl()
Description copied from interface: ReadableUserAgent
Returns the URL to the product or information page of an user agent.

Specified by:
getUrl in interface ReadableUserAgent
Returns:
the URL to the product page

getVersionNumber

public VersionNumber getVersionNumber()
Description copied from interface: ReadableUserAgent
Gets the version number of an user agent.

Specified by:
getVersionNumber in interface ReadableUserAgent
Returns:
version number of an user agent

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

@Nonnull
public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011-2014. All Rights Reserved.