| Modifier and Type | Field and Description |
|---|---|
| private static final ConcurrentMap | implementedInterfacesCache
Cache for the implemented interfaces searched. |
| private static final ConcurrentMap | isJdbcInterfaceCache
Cache for the JDBC interfaces already verified |
| private static int | |
| private static int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static Map | |
| public static Class | Returns: An array with all the interfaces for the given class.The class from which the interface list will be retrieved. clazz)Retrieves a list with all interfaces implemented by the given class. |
| public static < The return type of the new instance. T> T | Returns: if all validations succeed, an instance of the class with the specified name.the class of the return type of the new instance, usually an interface. returnType, String the name of the class to instantiate through reflection. className, Class<?>[] the type of the arguments of the constructor to be used for instantiating the class. argTypes, Object[] the arguments to supply when exectuing the new instance constructor. args, ExceptionInterceptor the exceptionInterceptor)ExceptionInterceptor to handle new exceptions thrown.Creates an instance of the specified class name through reflection using the given arguments, as long as the class implements the return type specified. |
| public static int | |
| public static int | |
| public static String | Returns: the package namethe Class from which to get the package name clazz)Returns the package name of the given class. |
| public static < The type of the new class instance to return. T> T | Returns: objectconstructor ctor, Object[] arguments for constructor args, ExceptionInterceptor exception interceptor exceptionInterceptor)Handles constructing new instance with the given constructor and wrapping (or not, as required) the exceptions that could possibly be generated. |
| public static boolean | Returns: true if version does not contain "enterprise", "commercial" or "advanced"full server version string serverVersion)Checks whether the given server version string is a MySQL Community edition. |
| public static boolean | Returns: true if version contains "enterprise", "commercial" or "advanced"full server version string serverVersion)Checks whether the given server version string is a MySQL Enterprise/Commercial edition. |
| public static boolean | Returns: booleanThe class to investigate. clazz)Recursively checks for interfaces on the given class to determine if it implements a java.sql, javax.sql or com.mysql.cj.jdbc interface. |
| public static boolean | Returns: booleanThe package name to check. packageName)Check if the package name is a known JDBC package. |
| public static boolean | Returns: true if currently running on Windows, false otherwise.Checks if the JVM is running on Windows Operating System. |
| public static boolean | |
| public static <T> List | loadClasses(Class<T> instancesType, String extensionClassNames, String errorMessageKey, ExceptionInterceptor exceptionInterceptor)
|
| public static final int | |
| public static final int | |
| public static int | |
| public static long | Returns: The number of seconds, truncated, elapsed since timeInMillis.The past instant in milliseconds. timeInMillis)Computes the number of seconds elapsed since the given time in milliseconds. |
| public static String | Returns: a message containing the exception, the message (if any), and a stacktrace.the exception to expand into a message. ex)Converts a nested exception into a nicer message. |
| public static int | Returns: int valuelong value longValue)Converts long to int, truncating to maximum/minimum value if needed. |
| public static int[] | Returns: int valueslog values longArray)Converts long[] to int[], truncating to maximum/minimum value if needed. |
| implementedInterfacesCache | back to summary |
|---|---|
| private static final ConcurrentMap<Class<?>, Class<?>[]> implementedInterfacesCache Cache for the implemented interfaces searched. | |
| isJdbcInterfaceCache | back to summary |
|---|---|
| private static final ConcurrentMap<Class<?>, Boolean> isJdbcInterfaceCache Cache for the JDBC interfaces already verified | |
| jvmUpdateNumber | back to summary |
|---|---|
| private static int jvmUpdateNumber | |
| jvmVersion | back to summary |
|---|---|
| private static int jvmVersion | |
| Util | back to summary |
|---|---|
| public Util() | |
| calculateDifferences | back to summary |
|---|---|
| public static Map | |
| getImplementedInterfaces | back to summary |
|---|---|
| public static Class Retrieves a list with all interfaces implemented by the given class. If possible gets this information from a cache instead of navigating through the object hierarchy. Results are stored in a cache for future reference. | |
| getInstance | back to summary |
|---|---|
| public static <T> T getInstance(Class<T> returnType, String className, Class<?>[] argTypes, Object[] args, ExceptionInterceptor exceptionInterceptor) Creates an instance of the specified class name through reflection using the given arguments, as long as the class implements the return type specified.
| |
| getJVMUpdateNumber | back to summary |
|---|---|
| public static int getJVMUpdateNumber() | |
| getJVMVersion | back to summary |
|---|---|
| public static int getJVMVersion() | |
| getPackageName | back to summary |
|---|---|
| public static String getPackageName(Class<?> clazz) Returns the package name of the given class. Using clazz.getPackage().getName() is not an alternative because under some class loaders the method getPackage() just returns null. | |
| handleNewInstance | back to summary |
|---|---|
| public static <T> T handleNewInstance(Constructor<T> ctor, Object[] args, ExceptionInterceptor exceptionInterceptor) Handles constructing new instance with the given constructor and wrapping (or not, as required) the exceptions that could possibly be generated.
| |
| isCommunityEdition | back to summary |
|---|---|
| public static boolean isCommunityEdition(String serverVersion) Checks whether the given server version string is a MySQL Community edition.
| |
| isEnterpriseEdition | back to summary |
|---|---|
| public static boolean isEnterpriseEdition(String serverVersion) Checks whether the given server version string is a MySQL Enterprise/Commercial edition.
| |
| isJdbcInterface | back to summary |
|---|---|
| public static boolean isJdbcInterface(Class<?> clazz) Recursively checks for interfaces on the given class to determine if it implements a java.sql, javax.sql or com.mysql.cj.jdbc interface.
| |
| isJdbcPackage | back to summary |
|---|---|
| public static boolean isJdbcPackage(String packageName) Check if the package name is a known JDBC package.
| |
| isRunningOnWindows | back to summary |
|---|---|
| public static boolean isRunningOnWindows() Checks if the JVM is running on Windows Operating System.
| |
| jvmMeetsMinimum | back to summary |
|---|---|
| public static boolean jvmMeetsMinimum(int version, int updateNumber) | |
| loadClasses | back to summary |
|---|---|
| public static <T> List | |
| readBlock | back to summary |
|---|---|
| public static final int readBlock(InputStream i, byte[] b, ExceptionInterceptor exceptionInterceptor) | |
| readBlock | back to summary |
|---|---|
| public static final int readBlock(InputStream i, byte[] b, int length, ExceptionInterceptor exceptionInterceptor) | |
| readFully | back to summary |
|---|---|
| public static int readFully(Reader reader, char[] buf, int length) throws IOException Reads length bytes from reader into buf. Blocks until enough input is available
| |
| secondsSinceMillis | back to summary |
|---|---|
| public static long secondsSinceMillis(long timeInMillis) Computes the number of seconds elapsed since the given time in milliseconds.
| |
| stackTraceToString | back to summary |
|---|---|
| public static String stackTraceToString(Throwable ex) Converts a nested exception into a nicer message. | |
| truncateAndConvertToInt | back to summary |
|---|---|
| public static int truncateAndConvertToInt(long longValue) Converts long to int, truncating to maximum/minimum value if needed.
| |
| truncateAndConvertToInt | back to summary |
|---|---|
| public static int[] truncateAndConvertToInt(long[] longArray) Converts long[] to int[], truncating to maximum/minimum value if needed.
| |