org.apache.commons.inject.util
Class Generics
java.lang.Object
org.apache.commons.inject.util.Generics
public class Generics
- extends Object
A utility class for dealing with generics.
Method Summary |
static
|
cast(Object pObject)
Casts the parameter into the given result type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Generics
public Generics()
cast
public static <T> T cast(Object pObject)
- Casts the parameter into the given result type.
Using this method is inheritly unsafe, because it's
tricking out the compiler. (Use it at your own risk.) On the other
hand, it is an effective way to omit unnecessary compiler warnings.
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.