com.brightcove.proserve.mediaapi.wrapper.utils
Class CollectionUtils

java.lang.Object
  extended by com.brightcove.proserve.mediaapi.wrapper.utils.CollectionUtils

public class CollectionUtils
extends java.lang.Object

This is a fairly simple set of static methods to perform operations on Collection objects (Lists, Arrays, Vectors, Sets, etc).

Author:
Sander Gates

Constructor Summary
CollectionUtils()
           
 
Method Summary
static java.util.Set<java.lang.Integer> CreateEmptyIntegerSet()
           
static java.util.Set<java.lang.Long> CreateEmptyLongSet()
           
static java.util.Set<java.lang.String> CreateEmptyStringSet()
           
static java.lang.String JoinToString(java.util.List<?> list, java.lang.String delimiter)
          Given a List and a delimiter, creates a delimited string of the objects in the List (using the toString() method of each object).
static java.lang.String JoinToString(java.util.List<?> list, java.lang.String delimiter, java.lang.Boolean escapeDelimiter, java.lang.String escapeSequence)
          Given a List and a delimiter, creates a delimited string of the objects in the List (using the toString() method of each object).
static java.lang.String JoinToString(java.util.Set<?> set, java.lang.String delimiter)
          Given a Set and a delimiter, creates a delimited string of the objects in the Set (using the toString() method of each object).
static java.lang.String JoinToString(java.util.Set<?> set, java.lang.String delimiter, java.lang.Boolean escapeDelimiter, java.lang.String escapeSequence)
          Given a Set and a delimiter, creates a delimited string of the objects in the Set (using the toString() method of each object).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionUtils

public CollectionUtils()
Method Detail

JoinToString

public static java.lang.String JoinToString(java.util.List<?> list,
                                            java.lang.String delimiter)

Given a List and a delimiter, creates a delimited string of the objects in the List (using the toString() method of each object).

Parameters:
list - List of objects
delimiter - Delimiter to separate the objects in the output String
Returns:
Delimited String of the objects in the List

JoinToString

public static java.lang.String JoinToString(java.util.List<?> list,
                                            java.lang.String delimiter,
                                            java.lang.Boolean escapeDelimiter,
                                            java.lang.String escapeSequence)

Given a List and a delimiter, creates a delimited string of the objects in the List (using the toString() method of each object).

Parameters:
list - List of objects
delimiter - Delimiter to separate the objects in the output String
escapeDelimiter - If true, delimiters in the original strings will be escaped with escapeSequence
escapeSequence - String to escape delimiters with
Returns:
Delimited String of the objects in the List

JoinToString

public static java.lang.String JoinToString(java.util.Set<?> set,
                                            java.lang.String delimiter)

Given a Set and a delimiter, creates a delimited string of the objects in the Set (using the toString() method of each object).

Parameters:
set - Set of objects
delimiter - Delimiter to separate the objects in the output String
Returns:
Delimited String of the objects in the Set

JoinToString

public static java.lang.String JoinToString(java.util.Set<?> set,
                                            java.lang.String delimiter,
                                            java.lang.Boolean escapeDelimiter,
                                            java.lang.String escapeSequence)

Given a Set and a delimiter, creates a delimited string of the objects in the Set (using the toString() method of each object).

Parameters:
set - Set of objects
delimiter - Delimiter to separate the objects in the output String
escapeDelimiter - If true, delimiters in the original strings will be escaped with escapeSequence
escapeSequence - String to escape delimiters with
Returns:
Delimited String of the objects in the Set

CreateEmptyLongSet

public static java.util.Set<java.lang.Long> CreateEmptyLongSet()

CreateEmptyStringSet

public static java.util.Set<java.lang.String> CreateEmptyStringSet()

CreateEmptyIntegerSet

public static java.util.Set<java.lang.Integer> CreateEmptyIntegerSet()