org.rhq.enterprise.agent
Class StringUtil

java.lang.Object
  extended by org.rhq.enterprise.agent.StringUtil

public class StringUtil
extends Object

Utilities that work with Strings.

Author:
John Mazzitelli

Method Summary
static String justifyKeyValueStrings(Map<?,?> key_value_pairs)
          Returns a string with the given key/value pairs formatted such that the key values are justified and ordered with each pair separated with a newline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

justifyKeyValueStrings

public static String justifyKeyValueStrings(Map<?,?> key_value_pairs)
Returns a string with the given key/value pairs formatted such that the key values are justified and ordered with each pair separated with a newline. This is useful when displaying menu items, for example, and want to show them in an orderly, formatted way. For example, if the given key value pairs are [first, This is the first], [second, This is second] and [last one, This is last], this will return a string that looks like this:
 first   : This is the first
 second  : This is the second
 last one: This is last
  

Parameters:
key_value_pairs -
Returns:
formatted string


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.