public class ImplementorUtils extends Object
| Constructor and Description |
|---|
ImplementorUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
cast(Object obj,
Class<T> targetClass)
Casts an object to the class or interface represented
by this Class object.
|
static <T> boolean |
isImplementationOf(Object obj,
Class<T> targetClass)
prueft, ob eine Objekt in den Zieltyp
targetClass zu casten
ist. |
public static <T> T cast(Object obj, Class<T> targetClass)
obj - the object to be casttargetClass - IllegalArgumentException - object oder Zielklasse sind undefiniertClassCastException - cast konnte nicht durch gefuehrt werdenpublic static <T> boolean isImplementationOf(Object obj, Class<T> targetClass)
targetClass zu casten
ist.
Wird null uebergeben, so wird false geliefert.obj - targetClass - IllegalArgumentException - object oder Zielklasse sind undefiniertClassCastException - cast konnte nicht durch gefuehrt werdenCopyright © 2017. All rights reserved.