com.pkrete.jsip2.variables
Class ItemTypeFactory

java.lang.Object
  extended by com.pkrete.jsip2.variables.ItemTypeFactory

public class ItemTypeFactory
extends Object

This class generates ItemType objects based on the item code. This class implements the Singleton design pattern, which means that only one instance is created at run time.

Author:
Petteri Kivimäki

Method Summary
 List<ItemType> getAllItemTypes()
          Returns a list that contains all the item types.
static ItemTypeFactory getInstance()
          Returns a reference to the singleton object.
 ItemType getItemType(String code)
          Returns the item type that matches the given code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ItemTypeFactory getInstance()
Returns a reference to the singleton object. The object is created when this method is called for the first time.

Returns:
reference to the singleton object

getItemType

public ItemType getItemType(String code)
                     throws InvalidSIP2ResponseValueException
Returns the item type that matches the given code.

Parameters:
code - item type code
Returns:
item type that matches the given code
Throws:
InvalidSIP2ResponseValueException

getAllItemTypes

public List<ItemType> getAllItemTypes()
Returns a list that contains all the item types.

Returns:
list of all the item types


Copyright © 2012-2014. All Rights Reserved.