org.apache.aries.jmx.util
Class TypeUtils

java.lang.Object
  extended by org.apache.aries.jmx.util.TypeUtils

public class TypeUtils
extends Object

This class provides common utilities related to type conversions for the MBean implementations

Version:
$Rev: 896239 $ $Date: 2010-01-05 22:02:23 +0000 (Tue, 05 Jan 2010) $

Field Summary
static Map<String,Class<? extends Object>> mathTypes
           
static Map<Class<? extends Object>,Class<? extends Object>> primitiveToWrapper
           
static Map<String,Class<? extends Object>> primitiveTypes
           
static Map<String,Class<? extends Object>> types
           
static Map<String,Class<? extends Object>> wrapperTypes
           
 
Method Summary
static Map<String,String> fromDictionary(Dictionary<String,String> dictionary)
          Converts a Dictionary object to a Map
static
<T> T
fromString(Class<T> type, String value)
          Converts a String value to an Object of the specified type
static Long[] toLong(long[] array)
          Converts primitive long[] array to Long[]
static long[] toPrimitive(Long[] array)
          Converts Long[] array to primitive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

primitiveTypes

public static Map<String,Class<? extends Object>> primitiveTypes

wrapperTypes

public static Map<String,Class<? extends Object>> wrapperTypes

mathTypes

public static Map<String,Class<? extends Object>> mathTypes

primitiveToWrapper

public static Map<Class<? extends Object>,Class<? extends Object>> primitiveToWrapper

types

public static Map<String,Class<? extends Object>> types
Method Detail

fromDictionary

public static Map<String,String> fromDictionary(Dictionary<String,String> dictionary)
Converts a Dictionary object to a Map

Parameters:
dictionary -
Returns:

toLong

public static Long[] toLong(long[] array)
Converts primitive long[] array to Long[]

Parameters:
array -
Returns:

toPrimitive

public static long[] toPrimitive(Long[] array)
Converts Long[] array to primitive

Parameters:
array -
Returns:

fromString

public static <T> T fromString(Class<T> type,
                               String value)
Converts a String value to an Object of the specified type

Parameters:
type - one of types listed in types
value -
Returns:
instance of class type
Throws:
IllegalArgumentException - if type or value are null or if the Class type does not support a valueOf() or cannot be converted to a wrapper type


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.