com.gisgraphy.util
Class ConvertUtil

java.lang.Object
  extended by com.gisgraphy.util.ConvertUtil

public final class ConvertUtil
extends java.lang.Object

Utility class to convert one object to another.


Method Summary
static java.util.Properties convertBundleToProperties(java.util.ResourceBundle rb)
          Method to convert a ResourceBundle to a Properties object.
static java.util.Map<java.lang.String,java.lang.String> convertListToMap(java.util.List<LabelValue> list)
          Convert a java.util.List of LabelValue objects to a LinkedHashMap.
static java.lang.Object populateObject(java.lang.Object obj, java.util.ResourceBundle rb)
          Convenience method used by tests to populate an object from a ResourceBundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convertListToMap

public static java.util.Map<java.lang.String,java.lang.String> convertListToMap(java.util.List<LabelValue> list)
Convert a java.util.List of LabelValue objects to a LinkedHashMap.

Parameters:
list - the list to convert
Returns:
the populated map with the label as the key

convertBundleToProperties

public static java.util.Properties convertBundleToProperties(java.util.ResourceBundle rb)
Method to convert a ResourceBundle to a Properties object.

Parameters:
rb - a given resource bundle
Returns:
Properties a populated properties object

populateObject

public static java.lang.Object populateObject(java.lang.Object obj,
                                              java.util.ResourceBundle rb)
Convenience method used by tests to populate an object from a ResourceBundle

Parameters:
obj - an initialized object
rb - a resource bundle
Returns:
a populated object


Copyright © 2010. All Rights Reserved.