org.codehaus.groovy.runtime.typehandling
Class DefaultTypeTransformation

Field Summary
 def EMPTY_ARGUMENTS
           
 BigInteger ONE_NEG
           
 
Constructor Summary
DefaultTypeTransformation()
           
 
Method Summary
static Collection arrayAsCollection(Object value)
          
static Object asArray(Object object, Class type)
          
static Collection asCollection(Object value)
          
static boolean booleanUnbox(Object value)
          
static Object box(boolean value)
          
static Object box(byte value)
          
static Object box(char value)
          
static Object box(short value)
          
static Object box(int value)
          
static Object box(long value)
          
static Object box(float value)
          
static Object box(double value)
          
static byte byteUnbox(Object value)
          
static boolean castToBoolean(Object object)
          
static char castToChar(Object object)
          
static Class castToClass(Object object)
          
static Number castToNumber(Object object)
          
static Object castToType(Object object, Class type)
          
static char charUnbox(Object value)
          
static boolean compareArrayEqual(Object left, Object right)
          
static boolean compareEqual(Object left, Object right)
          
static int compareTo(Object left, Object right)
           Compares the two objects handling nulls gracefully and performing numeric type coercion if required
static int compareToWithEqualityCheck(Object left, Object right, boolean equalityCheckOnly)
          
static def convertToBooleanArray(Object a)
          
static def convertToByteArray(Object a)
          
static def convertToCharArray(Object a)
          
static def convertToDoubleArray(Object a)
          
static def convertToFloatArray(Object a)
          
static def convertToIntArray(Object a)
          
static def convertToLongArray(Object a)
          
static Object convertToPrimitiveArray(Object a, Class type)
          
static def convertToShortArray(Object a)
          
static double doubleUnbox(Object value)
          
static float floatUnbox(Object value)
          
static int intUnbox(Object value)
          
static boolean isEnumSubclass(Object value)
           Determines whether the value object is a Class object representing a subclass of java.lang.Enum.
static boolean isValidCharacterString(Object value)
          
static long longUnbox(Object value)
          
static def primitiveArrayBox(Object array)
          
static List primitiveArrayToList(Object array)
           Allows conversion of arrays into a mutable List
static short shortUnbox(Object value)
          
 

Constructor Detail

DefaultTypeTransformation

DefaultTypeTransformation()


Method Detail

arrayAsCollection

public static Collection arrayAsCollection(Object value)


asArray

public static Object asArray(Object object, Class type)


asCollection

public static Collection asCollection(Object value)


booleanUnbox

public static boolean booleanUnbox(Object value)


box

public static Object box(boolean value)


box

public static Object box(byte value)


box

public static Object box(char value)


box

public static Object box(short value)


box

public static Object box(int value)


box

public static Object box(long value)


box

public static Object box(float value)


box

public static Object box(double value)


byteUnbox

public static byte byteUnbox(Object value)


castToBoolean

public static boolean castToBoolean(Object object)


castToChar

public static char castToChar(Object object)


castToClass

static Class castToClass(Object object)


castToNumber

public static Number castToNumber(Object object)


castToType

public static Object castToType(Object object, Class type)


charUnbox

public static char charUnbox(Object value)


compareArrayEqual

public static boolean compareArrayEqual(Object left, Object right)


compareEqual

public static boolean compareEqual(Object left, Object right)


compareTo

public static int compareTo(Object left, Object right)
Compares the two objects handling nulls gracefully and performing numeric type coercion if required


compareToWithEqualityCheck

static int compareToWithEqualityCheck(Object left, Object right, boolean equalityCheckOnly)


convertToBooleanArray

public static def convertToBooleanArray(Object a)


convertToByteArray

public static def convertToByteArray(Object a)


convertToCharArray

public static def convertToCharArray(Object a)


convertToDoubleArray

public static def convertToDoubleArray(Object a)


convertToFloatArray

public static def convertToFloatArray(Object a)


convertToIntArray

public static def convertToIntArray(Object a)


convertToLongArray

public static def convertToLongArray(Object a)


convertToPrimitiveArray

public static Object convertToPrimitiveArray(Object a, Class type)


convertToShortArray

public static def convertToShortArray(Object a)


doubleUnbox

public static double doubleUnbox(Object value)


floatUnbox

public static float floatUnbox(Object value)


intUnbox

public static int intUnbox(Object value)


isEnumSubclass

public static boolean isEnumSubclass(Object value)
Determines whether the value object is a Class object representing a subclass of java.lang.Enum. Uses class name check to avoid breaking on pre-Java 5 JREs.
param:
value an object
return:
true if the object is an Enum


isValidCharacterString

static boolean isValidCharacterString(Object value)
return:
true if the given value is a valid character string (i.e. has length of 1)


longUnbox

public static long longUnbox(Object value)


primitiveArrayBox

public static def primitiveArrayBox(Object array)


primitiveArrayToList

public static List primitiveArrayToList(Object array)
Allows conversion of arrays into a mutable List
param:
array an array
return:
the array as a List


shortUnbox

public static short shortUnbox(Object value)