org.opennms.core.utils
Class BundleLists

java.lang.Object
  extended by org.opennms.core.utils.BundleLists

public class BundleLists
extends Object

Contains utility functions for handling with bundle lists, that is, a comma-delimited list of strings that are contained as one line in a Java properties file. This class contains methods to parse and create these bundle lists.

Version:
$Id: $
Author:
Lawrence Karnowski , OpenNMS , Lawrence Karnowski , OpenNMS

Constructor Summary
BundleLists()
           
 
Method Summary
static String createBundleList(Object[] objArray)
          Parses a Object array and puts them into a array of substrings, using a comma as a delimiter
static String createBundleList(Object[] objArray, String delimiter)
          Parses a Object array and puts them into a array of substrings, using a comma as a delimiter
static String[] parseBundleList(String list)
          Parses a string into an array of substrings, using a comma as a delimiter and trimming whitespace.
static String[] parseBundleList(String list, String delimiter)
          Parses a string into an array of substrings, using the specified delimeter and trimming whitespace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleLists

public BundleLists()
Method Detail

parseBundleList

public static String[] parseBundleList(String list)
Parses a string into an array of substrings, using a comma as a delimiter and trimming whitespace.

Parameters:
list - The list formatted as a delimeter -delimited string.
Returns:
The list formatted as an array of strings.

parseBundleList

public static String[] parseBundleList(String list,
                                       String delimiter)
Parses a string into an array of substrings, using the specified delimeter and trimming whitespace.

Parameters:
list - The list formatted as a delimeter -delimited string.
delimiter - The delimeter.
Returns:
The list formatted as an array of strings.

createBundleList

public static String createBundleList(Object[] objArray)
Parses a Object array and puts them into a array of substrings, using a comma as a delimiter

Parameters:
objArray - The object array to be formatted as a comma-delimited string.
Returns:
The comma-delimited string.

createBundleList

public static String createBundleList(Object[] objArray,
                                      String delimiter)
Parses a Object array and puts them into a array of substrings, using a comma as a delimiter

Parameters:
objArray - The object array to be formatted as a comma-delimited string.
delimiter - a String object.
Returns:
The comma-delimited string.


Copyright © 2011. All Rights Reserved.