com.gisgraphy.util
Class ConvertUtil

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

public final class ConvertUtil
extends Object

Utility class to convert one object to another.


Method Summary
static Properties convertBundleToProperties(ResourceBundle rb)
          Method to convert a ResourceBundle to a Properties object.
static Map<String,String> convertListToMap(List<LabelValue> list)
          Convert a java.util.List of LabelValue objects to a LinkedHashMap.
static Object populateObject(Object obj, 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 Map<String,String> convertListToMap(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 Properties convertBundleToProperties(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 Object populateObject(Object obj,
                                    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 © 2012. All Rights Reserved.