public final class Reflect extends Object
A series of basic Reflect based utility functions. In most cases, exceptions thrown by the Reflect API methods
are caught and ignored choosing to return an Optional with no value instead.
| Modifier and Type | Method and Description |
|---|---|
static <T> com.google.common.base.Optional<Class<T>> |
getClass(String theClassName)
Returns the class with the given name.
|
static <T> com.google.common.base.Optional<Constructor<T>> |
getConstructor(Class<T> theClass,
Class<?>... theArgTypes)
Get the constructor of the class with the given arguments.
|
public static <T> com.google.common.base.Optional<Class<T>> getClass(String theClassName)
Optional with an absent value will be returned instead.
Similarly, if a ClassCastException is thrown, because the class name is valid, but is
not of the correct type of class requested by the user, an Optional without a value will be returned..theClassName - the class namepublic static <T> com.google.common.base.Optional<Constructor<T>> getConstructor(Class<T> theClass, Class<?>... theArgTypes)
Optional without a value is
returned.T - the class typetheClass - the class to get the constructor oftheArgTypes - the arguments to the constructorCopyright © 2010-2016 Stardog Union. All Rights Reserved.