Package org.moddingx.libx.util
Class ClassUtil
java.lang.Object
org.moddingx.libx.util.ClassUtil
Utilities for instances of the
Class class.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?> Returns the given class unless it's a primitive class in which case the boxed class for that primitive is returned.static Class<?> callerClass(int level) Gets the caller class for method call, the given amount of stack frames up.static Class<?> static Class<?> Returns the given class unless it's a boxed primitive class in which case the primitive class for that boxed class is returned.
-
Constructor Details
-
ClassUtil
public ClassUtil()
-
-
Method Details
-
boxed
Returns the given class unless it's a primitive class in which case the boxed class for that primitive is returned. -
unboxed
Returns the given class unless it's a boxed primitive class in which case the primitive class for that boxed class is returned. -
forName
-
callerClass
Gets the caller class for method call, the given amount of stack frames up. This skips reflection frames.- Parameters:
level- How many stack frames this should go up.0means the method that calledcallerClass(int).1is the class that called the method from whichcallerClass(int)was invoked.
-