public class FlexCommonUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
areEqual(java.lang.Object[] pObject1,
java.lang.Object[] pObject2)
Safe comparison of Object Arrays
|
static boolean |
areEqual(java.lang.Object pObject1,
java.lang.Object pObject2)
Safe comparison.
|
static boolean |
areNotEqual(java.lang.Object pObject1,
java.lang.Object pObject2)
Safe not equal comparison.
|
static byte[] |
buildByteArrayFromStoredChunks(java.util.List<java.lang.String> pData) |
static byte[] |
buildByteArrayFromStoredChunks(java.util.Map<java.lang.Integer,java.lang.String> pData)
helper method that allows passing Map of chunks, instead of List.
|
static java.lang.String |
buildStringFromChunks(java.util.List<java.lang.String> pData)
Rebuild String from chunks.
|
static java.lang.String |
buildStringFromChunks(java.util.Map<java.lang.Integer,java.lang.String> pData)
helper method that allows passing Map of chunks, instead of List.
|
static void |
close(java.io.Closeable c) |
static void |
closeInputStream(java.io.InputStream in) |
static void |
closeJDBCResource(java.sql.Connection c) |
static void |
closeJDBCResource(java.sql.PreparedStatement c) |
static void |
closeJDBCResource(java.sql.ResultSet c) |
static void |
closeJDBCResource(java.sql.Statement c) |
static void |
closeOutputStream(java.io.OutputStream output) |
static java.lang.String |
combineByDot(java.util.List<java.lang.String> pValue)
Matching toString for toList.
|
static java.lang.String |
combineBySpace(java.util.List<java.lang.String> pValue) |
static int |
countCharaters(java.lang.String pString,
char pChar)
counts occurrence of spcific character in input String.
|
static java.util.List |
createInitialiedList(int pSize,
java.lang.Object pInitialValue)
Create list of specified size with each element initialized.
|
static java.lang.Object |
createInstance(java.lang.Class pClazz) |
static java.lang.Object |
createInstance(java.lang.String pClazzName) |
static java.util.List<JavaBeanAttribute> |
deriveAttributes(java.lang.Class pClazz) |
static void |
flushAndClose(java.io.OutputStream pOut) |
static java.lang.String |
fromPascalOrCamelCaseToUppercaseSnakeCase(java.lang.String pStr)
Converts PascalCaseString or camelCaseString to UPPERCASE_SNAKE_CASE_STRING
|
static java.util.List<java.lang.reflect.Field> |
getAllClassFields(java.lang.Class pClazz)
get all fields (public and private) of a class including all Super classes.
|
static java.lang.String |
getBase64EncodedValue(java.lang.String pValue)
Encode the string value in Base64Encoded Value.
|
static java.lang.Object |
getJavaBeanAttributeValue(java.lang.Object pObject,
JavaBeanAttribute pAtt) |
static java.lang.String |
getLocalHostName() |
static java.lang.String |
getServerType() |
static java.lang.Object |
getValue(java.lang.Object pObject,
java.lang.String pGetMethodName) |
static java.util.List<java.lang.String> |
grep(java.util.List<java.lang.String> input,
java.lang.String matchString,
boolean ignorecase) |
static boolean |
hasLowerCaseLetter(java.lang.String pStr) |
static java.lang.Object |
invokeMethod(java.lang.Object pObject,
java.lang.String pMethodName)
Invoke method supplied object and return result.
|
static java.lang.Object |
invokeMethod(java.lang.Object pObject,
java.lang.String pMethodName,
java.lang.Class[] pParamTypes,
java.lang.Object... pParams)
Invoke method supplied object and return result.
|
static boolean |
isAlphaNumeric(char c) |
static boolean |
isAlphaNumeric(java.lang.String pStr) |
static boolean |
isAlphaNumericPlusUnderscore(java.lang.String pStr) |
static boolean |
isAt(char c) |
static boolean |
isBoolean(java.lang.String pValue) |
static boolean |
isColon(char c) |
static boolean |
isDash(char c) |
static boolean |
isDigit(char c) |
static boolean |
isDot(char c) |
static boolean |
isDouble(java.lang.String pValue) |
static boolean |
isEmpty(java.util.Collection pList) |
static boolean |
isEmpty(java.util.Map pMap) |
static boolean |
isEmpty(java.lang.Object[] pArray) |
static boolean |
isEmpty(java.lang.String pStr) |
static boolean |
isFloat(java.lang.String pValue) |
static boolean |
isGlassfish() |
static boolean |
isInteger(java.lang.String pValue) |
static boolean |
isLetter(char c) |
static boolean |
isLong(java.lang.String pValue) |
static boolean |
isNotEmpty(java.util.Collection pList) |
static boolean |
isNotEmpty(java.util.Map pMap) |
static boolean |
isNotEmpty(java.lang.Object[] pArray) |
static boolean |
isNotEmpty(java.lang.String pStr) |
static boolean |
isParentheses(char c) |
static boolean |
isRunningInContainer() |
static boolean |
isRunningInGlassfish() |
static boolean |
isRunningInTomcat() |
static boolean |
isRunningInWebLogic() |
static boolean |
isSpace(char c) |
static boolean |
isSquareBracket(char c) |
static boolean |
isStartsWithLetter(java.lang.String pStr) |
static boolean |
isTomcat() |
static boolean |
isUnderscore(char c) |
static boolean |
isWebLogic() |
static boolean |
isWindows() |
static java.lang.Class |
loadClass(java.lang.String pClazzName) |
static java.util.Map<java.lang.String,java.lang.String> |
loadProperties(java.lang.String pFileName)
Loads properties file using Absolute path or Class path.
|
static boolean |
matchesAllSearchTexts(java.lang.String pInputString,
java.util.List<java.lang.String> pSearchParts) |
static boolean |
matchesAnySearchText(java.lang.String pInputString,
java.util.List<java.lang.String> pSearchParts) |
static java.lang.String |
quote(java.lang.String pString) |
static java.util.List<java.lang.String> |
searchList(java.util.List<java.lang.String> pInputList,
java.lang.String pSearchText) |
static void |
setJavaBeanAttributeValue(java.lang.Object pObject,
JavaBeanAttribute pAtt,
java.lang.Object pValue) |
static void |
sleep(long pSleepMillis) |
static void |
sort(java.util.List pList,
java.lang.String pGetMethodName) |
static java.util.List<java.lang.String> |
splitByComma(java.lang.String pValue)
split input string by using comma(,) separator.
|
static java.util.List<java.lang.String> |
splitByDot(java.lang.String pValue)
split input string by using dot(.) separator.
|
static java.util.List<java.lang.String> |
splitBySpace(java.lang.String pValue)
split input string by using whitespace separator.
|
static java.util.List<java.lang.String> |
splitByteArrayIntoChunksForStorage(byte[] pBytes,
int pSize) |
static java.util.List<java.lang.String> |
splitStringIntoChunks(java.lang.String pString,
int pSize)
Split string into small chunks by size.
|
static java.lang.String |
toDebugString(java.lang.Object pObject) |
static java.util.List<java.lang.String> |
toList(java.lang.String pValue)
Create list using elements of input string, uses comma[(optional Whitespace),(optional whitespace)] as separator.
|
static java.util.List<java.lang.String> |
toList(java.lang.String pValue,
java.lang.String pSep) |
static java.lang.String |
toString(java.util.List<java.lang.String> pValue)
Matching toString for toList.
|
static java.lang.String |
toString(java.util.List<java.lang.String> pValue,
java.lang.String pSeparator)
Matching toString for toList.
|
static java.lang.String |
toString(java.util.List<java.lang.String> pValue,
java.lang.String pSeparator,
java.lang.Boolean pIncludeSpace)
Matching toString for toList.
|
static java.lang.String |
toString(java.lang.Object pValue) |
static java.lang.String |
trim(java.lang.String pStr) |
public static java.util.List<JavaBeanAttribute> deriveAttributes(java.lang.Class pClazz)
public static void setJavaBeanAttributeValue(java.lang.Object pObject, JavaBeanAttribute pAtt, java.lang.Object pValue)
public static java.lang.Object getJavaBeanAttributeValue(java.lang.Object pObject, JavaBeanAttribute pAtt)
public static java.lang.Object invokeMethod(java.lang.Object pObject, java.lang.String pMethodName)
pObject
- pMethodName
- public static java.lang.Object invokeMethod(java.lang.Object pObject, java.lang.String pMethodName, java.lang.Class[] pParamTypes, java.lang.Object... pParams)
pObject
- pMethodName
- pParamTypes
- pParams
- public static java.lang.Object getValue(java.lang.Object pObject, java.lang.String pGetMethodName)
public static java.lang.Object createInstance(java.lang.Class pClazz)
public static java.lang.Object createInstance(java.lang.String pClazzName)
public static java.lang.Class loadClass(java.lang.String pClazzName)
public static java.util.Map<java.lang.String,java.lang.String> loadProperties(java.lang.String pFileName)
pFileName
- public static void closeInputStream(java.io.InputStream in)
public static void closeOutputStream(java.io.OutputStream output)
public static void close(java.io.Closeable c)
public static void closeJDBCResource(java.sql.Connection c)
public static void closeJDBCResource(java.sql.Statement c)
public static void closeJDBCResource(java.sql.PreparedStatement c)
public static void closeJDBCResource(java.sql.ResultSet c)
public static boolean isNotEmpty(java.lang.String pStr)
public static boolean isEmpty(java.lang.String pStr)
public static boolean isEmpty(java.util.Collection pList)
public static boolean isEmpty(java.util.Map pMap)
public static boolean isEmpty(java.lang.Object[] pArray)
public static boolean isNotEmpty(java.util.Collection pList)
public static boolean isNotEmpty(java.util.Map pMap)
public static boolean isNotEmpty(java.lang.Object[] pArray)
public static boolean isAlphaNumeric(java.lang.String pStr)
public static boolean isAlphaNumericPlusUnderscore(java.lang.String pStr)
public static boolean isAlphaNumeric(char c)
public static boolean isLetter(char c)
public static boolean hasLowerCaseLetter(java.lang.String pStr)
public static boolean isDigit(char c)
public static boolean isUnderscore(char c)
public static boolean isSpace(char c)
public static boolean isDot(char c)
public static boolean isColon(char c)
public static boolean isDash(char c)
public static boolean isAt(char c)
public static boolean isSquareBracket(char c)
public static boolean isParentheses(char c)
public static void sleep(long pSleepMillis)
public static void flushAndClose(java.io.OutputStream pOut)
public static java.util.List<java.lang.String> toList(java.lang.String pValue)
pValue
- public static java.util.List<java.lang.String> toList(java.lang.String pValue, java.lang.String pSep)
public static java.lang.String toString(java.util.List<java.lang.String> pValue)
pValue
- public static java.lang.String toString(java.util.List<java.lang.String> pValue, java.lang.String pSeparator)
pValue
- pSeparator
- public static java.lang.String toString(java.util.List<java.lang.String> pValue, java.lang.String pSeparator, java.lang.Boolean pIncludeSpace)
pValue
- pSeparator
- public static java.util.List<java.lang.String> splitByComma(java.lang.String pValue)
pValue
- public static java.util.List<java.lang.String> splitByDot(java.lang.String pValue)
pValue
- public static java.util.List<java.lang.String> splitBySpace(java.lang.String pValue)
pValue
- public static java.lang.String combineByDot(java.util.List<java.lang.String> pValue)
pValue
- public static java.lang.String combineBySpace(java.util.List<java.lang.String> pValue)
public static java.lang.String toString(java.lang.Object pValue)
public static java.lang.String toDebugString(java.lang.Object pObject)
public static boolean isWindows()
public static java.lang.String getLocalHostName()
public static java.util.List<java.lang.String> grep(java.util.List<java.lang.String> input, java.lang.String matchString, boolean ignorecase)
public static int countCharaters(java.lang.String pString, char pChar)
pString
- pChar
- public static java.util.List createInitialiedList(int pSize, java.lang.Object pInitialValue)
pSize
- pInitialValue
- public static java.lang.String quote(java.lang.String pString)
public static java.util.List<java.lang.reflect.Field> getAllClassFields(java.lang.Class pClazz)
pClazz
- public static void sort(java.util.List pList, java.lang.String pGetMethodName)
public static boolean areEqual(java.lang.Object pObject1, java.lang.Object pObject2)
pObject1
- pObject2
- public static boolean areNotEqual(java.lang.Object pObject1, java.lang.Object pObject2)
pObject1
- pObject2
- public static boolean areEqual(java.lang.Object[] pObject1, java.lang.Object[] pObject2)
pObject1
- pObject2
- public static java.util.List<java.lang.String> splitStringIntoChunks(java.lang.String pString, int pSize)
pString
- pSize
- public static java.lang.String buildStringFromChunks(java.util.List<java.lang.String> pData)
pData
- public static java.lang.String buildStringFromChunks(java.util.Map<java.lang.Integer,java.lang.String> pData)
pData
- public static boolean isRunningInContainer()
public static boolean isRunningInWebLogic()
public static boolean isRunningInGlassfish()
public static boolean isRunningInTomcat()
public static java.util.List<java.lang.String> splitByteArrayIntoChunksForStorage(byte[] pBytes, int pSize)
public static byte[] buildByteArrayFromStoredChunks(java.util.List<java.lang.String> pData)
public static byte[] buildByteArrayFromStoredChunks(java.util.Map<java.lang.Integer,java.lang.String> pData)
pData
- public static boolean isInteger(java.lang.String pValue)
public static boolean isBoolean(java.lang.String pValue)
public static boolean isLong(java.lang.String pValue)
public static boolean isDouble(java.lang.String pValue)
public static boolean isFloat(java.lang.String pValue)
public static boolean isWebLogic()
public static boolean isGlassfish()
public static boolean isTomcat()
public static java.util.List<java.lang.String> searchList(java.util.List<java.lang.String> pInputList, java.lang.String pSearchText)
public static boolean matchesAllSearchTexts(java.lang.String pInputString, java.util.List<java.lang.String> pSearchParts)
public static boolean matchesAnySearchText(java.lang.String pInputString, java.util.List<java.lang.String> pSearchParts)
public static boolean isStartsWithLetter(java.lang.String pStr)
public static java.lang.String getServerType()
public static java.lang.String trim(java.lang.String pStr)
public static java.lang.String fromPascalOrCamelCaseToUppercaseSnakeCase(java.lang.String pStr)
pStr
- public static java.lang.String getBase64EncodedValue(java.lang.String pValue)
pValue
-