com.im.ijc.core.api.util
Class LookupProviders
java.lang.Object
com.im.ijc.core.api.util.LookupProviders
public final class LookupProviders
- extends Object
Helper class for Lookup.Provider.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lookup
public static <T> T lookup(Object obj,
Class<T> clazz)
- If
obj implements Lookup.Provider look up an instance of a given clazz
from the lookup. Otherwise try to cast to the given clazz. If that fails return null.
- Type Parameters:
T - service type- Parameters:
obj - object with serviceclazz - service type
- Returns:
- instance of service or
null