sk.baka.ambient.collection
Class CategoryItem.Builder

java.lang.Object
  extended by sk.baka.ambient.collection.CategoryItem.Builder
Enclosing class:
CategoryItem

public static class CategoryItem.Builder
extends Object

Builds the CategoryItem.

Author:
Martin Vysny

Field Summary
 int albums
          Contains a number of albums for given artist or genre.
 CategoryEnum category
          The category of this item, must not be null.
 Object id
          The collection-strategy-dependent ID, may be null.
 String name
          The name of the item, may be null if the name is missing.
 int songs
          Contains a number of songs for given artist, genre or album.
 String year
          In case of an album the year may be specified.
 
Constructor Summary
CategoryItem.Builder()
           
 
Method Summary
 CategoryItem build()
          Builds new category item.
 CategoryItem.Builder getData(CategoryItem item)
          Fills this builder with data from given item.
 CategoryItem.Builder setAlbums(int albums)
          Contains a number of albums for given artist or genre.
 CategoryItem.Builder setCategory(CategoryEnum category)
          Sets the category.
 CategoryItem.Builder setId(Object id)
          Sets id.
 CategoryItem.Builder setName(String name)
          Sets name.
 CategoryItem.Builder setSongs(int songs)
          Contains a number of songs for given artist, genre or album.
 CategoryItem.Builder setYear(String year)
          Sets year.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

public Object id
The collection-strategy-dependent ID, may be null.


name

public String name
The name of the item, may be null if the name is missing.


year

public String year
In case of an album the year may be specified. null if not known.


category

public CategoryEnum category
The category of this item, must not be null.


albums

public int albums
Contains a number of albums for given artist or genre. Equals to 1 for CategoryEnum.Title and CategoryEnum.Album categories. May be -1 if not known.


songs

public int songs
Contains a number of songs for given artist, genre or album. Equals to 1 for CategoryEnum.Title. May be -1 if not known.

Constructor Detail

CategoryItem.Builder

public CategoryItem.Builder()
Method Detail

build

public CategoryItem build()
Builds new category item.

Returns:
the category item instance.

setId

public CategoryItem.Builder setId(Object id)
Sets id.

Parameters:
id - The collection-strategy-dependent ID, may be null.
Returns:
this

setName

public CategoryItem.Builder setName(String name)
Sets name.

Parameters:
name - The name of the item.
Returns:
this

setYear

public CategoryItem.Builder setYear(String year)
Sets year.

Parameters:
year - In case of an album the year may be specified. null if not known.
Returns:
this

setCategory

public CategoryItem.Builder setCategory(CategoryEnum category)
Sets the category.

Parameters:
category - The category of this item, must not be null.
Returns:
this

setAlbums

public CategoryItem.Builder setAlbums(int albums)
Contains a number of albums for given artist or genre. Equals to 1 for CategoryEnum.Title and CategoryEnum.Album categories. May be -1 if not known.

Parameters:
albums - The number of albums for this item.
Returns:
this

setSongs

public CategoryItem.Builder setSongs(int songs)
Contains a number of songs for given artist, genre or album. Equals to 1 for CategoryEnum.Title. May be -1 if not known.

Parameters:
songs - The number of songs for this item.
Returns:
this

getData

public CategoryItem.Builder getData(CategoryItem item)
Fills this builder with data from given item.

Parameters:
item - the item to read
Returns:
this


Copyright © 2007-2008. All Rights Reserved.