Package com.esotericsoftware.kryo.util
Class Util
- java.lang.Object
-
- com.esotericsoftware.kryo.util.Util
-
public class Util extends Object
A few utility methods, mostly for private use.- Author:
- Nathan Sweet
-
-
Field Summary
Fields Modifier and Type Field Description static booleanisAndroidstatic intmaxArraySize
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringclassName(Class type)Returns the class formatted as a string.static intgetDimensionCount(Class arrayClass)Returns the number of dimensions of an array.static ClassgetElementClass(Class arrayClass)Returns the base element type of an n-dimensional array class.static ClassgetPrimitiveClass(Class type)Returns the primitive class for a primitive wrapper class.static ClassgetWrapperClass(Class type)Returns the primitive wrapper class for a primitive class.static booleanisClassAvailable(String className)static booleanisWrapperClass(Class type)static voidlog(String message, Object object)Logs a message about an object.static Stringstring(Object object)Returns the object formatted as a string.
-
-
-
Field Detail
-
isAndroid
public static final boolean isAndroid
-
maxArraySize
public static final int maxArraySize
- See Also:
- Constant Field Values
-
-
Method Detail
-
isClassAvailable
public static boolean isClassAvailable(String className)
-
getWrapperClass
public static Class getWrapperClass(Class type)
Returns the primitive wrapper class for a primitive class.- Parameters:
type- Must be a primitive class.
-
getPrimitiveClass
public static Class getPrimitiveClass(Class type)
Returns the primitive class for a primitive wrapper class. Otherwise returns the type parameter.- Parameters:
type- Must be a wrapper class.
-
isWrapperClass
public static boolean isWrapperClass(Class type)
-
log
public static void log(String message, Object object)
Logs a message about an object. The log level and the string format of the object depend on the object type.
-
string
public static String string(Object object)
Returns the object formatted as a string. The format depends on the object's type and whetherObject.toString()has been overridden.
-
className
public static String className(Class type)
Returns the class formatted as a string. The format varies depending on the type.
-
getDimensionCount
public static int getDimensionCount(Class arrayClass)
Returns the number of dimensions of an array.
-
-