-
Method Summary
static <T> T
Returns the provided object cast to the generic parameter type or null when the argument is null.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
cast
public static <T> T cast(Object o)
Returns the provided object cast to the generic parameter type or null when the argument is null.
- Type Parameters:
T
- the type to cast
- Parameters:
o
- object to cast
- Returns:
- object after casting or null if the object was null
- Throws:
ClassCastException
- if the object cannot be cast to the provided type