net.anidb.udp
Class UdpGroupFactory

java.lang.Object
  extended by net.anidb.udp.UdpGroupFactory

public class UdpGroupFactory
extends java.lang.Object

A factory for Group objects.

Version:
1.0, 26.12.2009
Author:
grizzlyxp (http://anidb.net/perl-bin/animedb.pl?show=userpage&uid=63935)

Method Summary
 Group getGroup(long groupId)
          Returns the group with the given group Id.
 Group getGroup(java.lang.String groupName)
          Returns the group with the given group name or short name.
static UdpGroupFactory getInstance(UdpConnection conn)
          Returns an instance of this class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static UdpGroupFactory getInstance(UdpConnection conn)
Returns an instance of this class.

Parameters:
conn - The connection.
Returns:
The instance.
Throws:
java.lang.IllegalArgumentException - If the connection is null.

getGroup

public Group getGroup(long groupId)
               throws UdpConnectionException,
                      AniDbException
Returns the group with the given group Id.

Parameters:
groupId - The group Id.
Returns:
The group.
Throws:
UdpConnectionException - If a connection problem occured.
AniDbException - If a problem with AniDB occured.
See Also:
UdpReturnCodes.NO_SUCH_GROUP

getGroup

public Group getGroup(java.lang.String groupName)
               throws UdpConnectionException,
                      AniDbException
Returns the group with the given group name or short name.

Parameters:
groupName - The group name or short name.
Returns:
The group.
Throws:
java.lang.IllegalArgumentException - If the group name is null.
UdpConnectionException - If a connection problem occured.
AniDbException - If a problem with AniDB occured.
See Also:
UdpReturnCodes.NO_SUCH_GROUP