net.dontdrinkandroot.lastfm.api.model

## Class Tag

- java.lang.Object
- - net.dontdrinkandroot.lastfm.api.model.LfmEntity
  - - net.dontdrinkandroot.lastfm.api.model.Tag

All Implemented Interfaces:
  Serializable, CountEntity, Entity, NameEntity, ReachEntity, StreamableEntity, TaggingsEntity, UrlEntity, WikiEntity

    public class Tag
    extends LfmEntity
    implements NameEntity, UrlEntity, CountEntity, TaggingsEntity, ReachEntity, StreamableEntity, WikiEntity

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`Tag()`
`Tag(Element element)` Construct Tag from dom Element.
`Tag(String name)`

### Method Summary

Methods
`boolean` `equals(Object obj)`
`Integer` `getCount()`
`static UnauthenticatedGetQuery<Tag>` `getInfo(String tag, net.dontdrinkandroot.utils.ISO_3166_1_alpha2 lang)` Get the metadata for a tag.
`String` `getName()`
`Integer` `getReach()`
`Streamable` `getStreamable()`
`Integer` `getTaggings()`
`static UnauthenticatedGetQuery<PaginatedResult<List<Album>>>` `getTopAlbums(String tagName, Integer limit, Integer page)` Get the top albums tagged by this tag, ordered by tag count.
`static UnauthenticatedGetQuery<PaginatedResult<List<Artist>>>` `getTopArtists(String tagName, Integer limit, Integer page)` Get the top artists tagged by this tag, ordered by tag count.
`static UnauthenticatedGetQuery<ArrayList<Tag>>` `getTopTags()` Fetches the top global tags on Last.fm, sorted by popularity (number oftimes used).
`static UnauthenticatedGetQuery<PaginatedResult<List<Track>>>` `getTopTracks(String tagName, Integer limit, Integer page)` Get the top tracks tagged by this tag, ordered by tag count.
`URL` `getUrl()`
`Wiki` `getWiki()`
`int` `hashCode()`
`void` `setCount(Integer count)`
`void` `setName(String name)`
`void` `setReach(Integer reach)`
`void` `setStreamable(Streamable streamable)`
`void` `setTaggings(Integer taggings)`
`void` `setUrl(URL url)`
`void` `setWiki(Wiki wiki)`
`String` `toString()`

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### Tag

    public Tag()

#### Tag

    public Tag(Element element)

Construct Tag from dom Element.

Parameters:
  `element` - The dom Element to convert.

#### Tag

    public Tag(String name)

### Method Detail

#### getName

    public final String getName()

Specified by:
  `getName` in interface `NameEntity`

#### setName

    public final void setName(String name)

Specified by:
  `setName` in interface `NameEntity`

#### getUrl

    public final URL getUrl()

Specified by:
  `getUrl` in interface `UrlEntity`

#### setUrl

    public final void setUrl(URL url)

Specified by:
  `setUrl` in interface `UrlEntity`

#### getCount

    public final Integer getCount()

Specified by:
  `getCount` in interface `CountEntity`

#### setCount

    public final void setCount(Integer count)

Specified by:
  `setCount` in interface `CountEntity`

#### getReach

    public final Integer getReach()

Specified by:
  `getReach` in interface `ReachEntity`

#### setReach

    public final void setReach(Integer reach)

Specified by:
  `setReach` in interface `ReachEntity`

#### getTaggings

    public final Integer getTaggings()

Specified by:
  `getTaggings` in interface `TaggingsEntity`

#### setTaggings

    public final void setTaggings(Integer taggings)

Specified by:
  `setTaggings` in interface `TaggingsEntity`

#### getStreamable

    public final Streamable getStreamable()

Specified by:
  `getStreamable` in interface `StreamableEntity`

#### setStreamable

    public final void setStreamable(Streamable streamable)

Specified by:
  `setStreamable` in interface `StreamableEntity`

#### getWiki

    public final Wiki getWiki()

Specified by:
  `getWiki` in interface `WikiEntity`

#### setWiki

    public final void setWiki(Wiki wiki)

Specified by:
  `setWiki` in interface `WikiEntity`

#### toString

    public final String toString()

Overrides:
  `toString` in class `Object`

#### hashCode

    public final int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public final boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### getInfo

    public static UnauthenticatedGetQuery<Tag> getInfo(String tag,
                                       net.dontdrinkandroot.utils.ISO_3166_1_alpha2 lang)

Get the metadata for a tag.

Parameters:
  `tag` - The tag name (Required).
  `lang` - The language to return the wiki in, expressed as an ISO 639 alpha-2 code (Optional).
Returns:

#### getTopAlbums

    public static UnauthenticatedGetQuery<PaginatedResult<List<Album>>> getTopAlbums(String tagName,
                                                                     Integer limit,
                                                                     Integer page)

Get the top albums tagged by this tag, ordered by tag count. *

Parameters:
  `tagName` - The tag name (Required).
  `limit` - The number of results to fetch per page (Optional). Defaults to 50.
  `page` - he page number to fetch (Optional). Defaults to first page.

#### getTopArtists

    public static UnauthenticatedGetQuery<PaginatedResult<List<Artist>>> getTopArtists(String tagName,
                                                                       Integer limit,
                                                                       Integer page)

Get the top artists tagged by this tag, ordered by tag count.

Parameters:
  `tagName` - The tag name (Required).
  `limit` - The number of results to fetch per page (Optional). Defaults to 50.
  `page` - he page number to fetch (Optional). Defaults to first page.

#### getTopTags

    public static UnauthenticatedGetQuery<ArrayList<Tag>> getTopTags()

Fetches the top global tags on Last.fm, sorted by popularity (number oftimes used). TODO: Using arraylist here to avoid complex generics.

Returns:
  The query needed to fetch the TopTags.

#### getTopTracks

    public static UnauthenticatedGetQuery<PaginatedResult<List<Track>>> getTopTracks(String tagName,
                                                                     Integer limit,
                                                                     Integer page)

Get the top tracks tagged by this tag, ordered by tag count.

Parameters:
  `tagName` - The tag name (Required).
  `limit` - The number of results to fetch per page (Optional). Defaults to 50.
  `page` - he page number to fetch (Optional). Defaults to first page.