org.opengts.war.tools
Class IDDescription

java.lang.Object
  extended by org.opengts.war.tools.IDDescription

public class IDDescription
extends java.lang.Object


Nested Class Summary
static class IDDescription.SortBy
          "SortBy" Enumeration
 
Constructor Summary
IDDescription(java.lang.String id, java.lang.String desc)
          Constructor
IDDescription(java.lang.String id, java.lang.String desc, java.lang.String name)
          Constructor
 
Method Summary
 java.lang.String getDescription()
          Returns the object Description
 java.lang.String getID()
          Returns the object ID
 java.lang.String getName()
          Returns the object Name
static IDDescription.SortBy GetSortBy(IDDescription.SortBy sortBy)
          Returns the specified 'SortBy' Enumeration, or the default 'SortBy' if null.
static IDDescription.SortBy GetSortBy(java.lang.String sortBy)
          Returns the 'SortBy' Enumeration for the specified sortBy string value
 java.lang.String getSortByString(IDDescription.SortBy sortBy)
          Returns the object Description/Name/ID (first item which isn't null)
static java.util.List<IDDescription> SortList(java.util.List<IDDescription> idList, IDDescription.SortBy sortBy)
          Sorts the specified IDDescription list by the specified field
static java.util.List<IDDescription> SortList(java.util.List<IDDescription> idList, java.lang.String sortBy)
          Sorts the specified IDDescription list by the specified field
 java.lang.String toString()
          Returns the object String representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IDDescription

public IDDescription(java.lang.String id,
                     java.lang.String desc)
Constructor

Parameters:
id - The object ID
desc - The object description

IDDescription

public IDDescription(java.lang.String id,
                     java.lang.String desc,
                     java.lang.String name)
Constructor

Parameters:
id - The object ID
desc - The object description
name - The object name
Method Detail

GetSortBy

public static IDDescription.SortBy GetSortBy(java.lang.String sortBy)
Returns the 'SortBy' Enumeration for the specified sortBy string value

Parameters:
sortBy - Text representation of 'SortBy'
Returns:
The 'SortBy' value (is never null)

GetSortBy

public static IDDescription.SortBy GetSortBy(IDDescription.SortBy sortBy)
Returns the specified 'SortBy' Enumeration, or the default 'SortBy' if null.

Parameters:
sortBy - 'SortBy' Enumeration (may be null)
Returns:
The 'SortBy' Enumeration (is never null)

SortList

public static java.util.List<IDDescription> SortList(java.util.List<IDDescription> idList,
                                                     java.lang.String sortBy)
Sorts the specified IDDescription list by the specified field

Parameters:
idList - The IDDescription list to sort (in place)
sortBy - The name of the field by which to sort
Returns:
The argment idList

SortList

public static java.util.List<IDDescription> SortList(java.util.List<IDDescription> idList,
                                                     IDDescription.SortBy sortBy)
Sorts the specified IDDescription list by the specified field

Parameters:
idList - The IDDescription list to sort (in place)
sortBy - The name of the field by which to sort
Returns:
The argment idList

getID

public java.lang.String getID()
Returns the object ID

Returns:
The Object ID

getDescription

public java.lang.String getDescription()
Returns the object Description

Returns:
The Object Description

getName

public java.lang.String getName()
Returns the object Name

Returns:
The Object Description

getSortByString

public java.lang.String getSortByString(IDDescription.SortBy sortBy)
Returns the object Description/Name/ID (first item which isn't null)

Returns:
The Object Description/Name/ID

toString

public java.lang.String toString()
Returns the object String representation

Overrides:
toString in class java.lang.Object
Returns:
The object String representation