# UserAgent (Crawler-commons 0.6-SNAPSHOT API)
Date: 2015-05-26

crawlercommons.fetcher.http

## Class UserAgent

- java.lang.Object
- - crawlercommons.fetcher.http.UserAgent

All Implemented Interfaces:
  Serializable

    public class UserAgent
    extends Object
    implements Serializable

User Agent enables us to describe characteristics of any Crawler Commons agent. There are a number of constructor options to describe the following:

1. `_agentName`: Primary agent name.
2. `_emailAddress`: The agent owners email address.
3. `_webAddress`: A web site/address representing the agent owner.
4. `_browserVersion`: Broswer version used for compatibility.
5. `_crawlerVersion`: Version of the user agents personal crawler. If this is not set, it defaults to the crawler commons maven artifact version.

See Also:
  Serialized Form

### Field Summary

Fields
`static String` `DEFAULT_BROWSER_VERSION`
`static String` `DEFAULT_CRAWLER_VERSION`

### Constructor Summary

Constructors
Constructor and Description
`UserAgent(String agentName, String emailAddress, String webAddress)` Set user agent characteristics
`UserAgent(String agentName, String emailAddress, String webAddress, String browserVersion)` Set user agent characteristics
`UserAgent(String agentName, String emailAddress, String webAddress, String browserVersion, String crawlerVersion)` Set user agent characteristics

### Method Summary

Methods
`String` `getAgentName()` Obtain the just the user agent name
`String` `getUserAgentString()` Obtain a String representing the user agent characteristics.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DEFAULT_BROWSER_VERSION

    public static final String DEFAULT_BROWSER_VERSION

See Also:
  Constant Field Values

#### DEFAULT_CRAWLER_VERSION

    public static final String DEFAULT_CRAWLER_VERSION

### Constructor Detail

#### UserAgent

    public UserAgent(String agentName,
             String emailAddress,
             String webAddress)

Set user agent characteristics

Parameters:
  `agentName` -
  `emailAddress` -
  `webAddress` -

#### UserAgent

    public UserAgent(String agentName,
             String emailAddress,
             String webAddress,
             String browserVersion)

Set user agent characteristics

Parameters:
  `agentName` -
  `emailAddress` -
  `webAddress` -
  `browserVersion` -

#### UserAgent

    public UserAgent(String agentName,
             String emailAddress,
             String webAddress,
             String browserVersion,
             String crawlerVersion)

Set user agent characteristics

Parameters:
  `agentName` -
  `emailAddress` -
  `webAddress` -
  `browserVersion` -
  `crawlerVersion` -

### Method Detail

#### getAgentName

    public String getAgentName()

Obtain the just the user agent name

Returns:
  User Agent name (String)

#### getUserAgentString

    public String getUserAgentString()

Obtain a String representing the user agent characteristics.

Returns:
  User Agent String