public class CommonUtils extends Object
| Constructor and Description |
|---|
CommonUtils() |
| Modifier and Type | Method and Description |
|---|---|
static FileFilter |
createFilenameFilter(String ext)
Creates the filename filter.
|
static <T> Future<T> |
doAsycnCall(String id,
Map<String,Future<T>> mapFutures,
Callable<T> callable,
ExecutorService executorService)
Do asycn call.
|
static String |
getStackTrace(Throwable throwable)
Gets the stack trace.
|
static String |
initCap(String str)
Inits the cap.
|
static String |
initLower(String str)
Inits the lower.
|
static boolean |
isEmpty(String str)
Checks if is empty.
|
static Class<?> |
loadClass(String clzName)
Load class.
|
static String |
replaceLast(String orginalStr,
String searchStr,
String replaceStr)
Replace last.
|
static <T> T |
waitForAsychCallsToComplete(Future<T> future,
int pollPauseDuration)
Wait for asych calls to complete.
|
static <T> Map<String,T> |
waitForAsychCallsToComplete(Map<String,Future<T>> mapFutures,
int responsePollingPauseDurationInMillis)
Wait for asych calls to complete.
|
public static Class<?> loadClass(String clzName)
clzName - the clz namepublic static String initCap(String str)
str - the strpublic static String initLower(String str)
str - the strpublic static String replaceLast(String orginalStr, String searchStr, String replaceStr)
orginalStr - the orginal strsearchStr - the search strreplaceStr - the replace strpublic static boolean isEmpty(String str)
str - the strpublic static String getStackTrace(Throwable throwable)
throwable - the throwablepublic static FileFilter createFilenameFilter(String ext)
ext - the extpublic static <T> Future<T> doAsycnCall(String id, Map<String,Future<T>> mapFutures, Callable<T> callable, ExecutorService executorService)
T - the generic typeid - the idmapFutures - the map futurescallable - the callableexecutorService - the executor servicepublic static <T> Map<String,T> waitForAsychCallsToComplete(Map<String,Future<T>> mapFutures, int responsePollingPauseDurationInMillis)
T - the generic typemapFutures - the map futuresresponsePollingPauseDurationInMillis - the response polling pause duration in millispublic static <T> T waitForAsychCallsToComplete(Future<T> future, int pollPauseDuration)
T - the generic typefuture - the futurepollPauseDuration - the poll pause durationCopyright © 2021. All rights reserved.