org.apache.commons.convert
Class Util

java.lang.Object
  extended by org.apache.commons.convert.Util

public class Util
extends Object

Utility methods.


Method Summary
static
<V> V
cast(Object object)
          Convenience method to cast parameterized types.
static boolean instanceOf(Class<?> objectClass, Class<?> typeClass)
          Tests if a class is the same class as, or sub-class of, or implements typeClass.
static boolean isEmpty(String str)
          Returns true if str is null or empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

cast

public static <V> V cast(Object object)
Convenience method to cast parameterized types.

Type Parameters:
V - The type to cast to
Parameters:
object - The object to cast
Returns:
obj cast to type V

instanceOf

public static boolean instanceOf(Class<?> objectClass,
                                 Class<?> typeClass)
Tests if a class is the same class as, or sub-class of, or implements typeClass.

Parameters:
objectClass - Class to test
typeClass - Class to test against
Returns:
true if objectClass is the same class as, or sub-class of, or implements typeClass

isEmpty

public static boolean isEmpty(String str)
Returns true if str is null or empty.

Parameters:
str - The String to test
Returns:
true if str is null or empty


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