public final class Utils
extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BOOLEAN
The BOOLEAN.
|
static String |
DATE
The DATE.
|
static long |
EPOCH_TRESHOLD |
static String |
INTEGER
The INTEGER.
|
static String |
LIST
The LIST.
|
static String |
LONG
The LONG.
|
static String |
NEWLINE
OS dependent 'end of the line' character.
|
static String |
NUMBER
The Constant NUMBER.
|
static long |
ONE_DAY
The Constant ONE_DAY.
|
static String |
RADIO
The RADIO.
|
static String |
STRING
The STRING.
|
static String |
TIME
The TIME.
|
static String |
TIMESTAMP
The TIMESTAMP.
|
static String |
WHITESPACE
Whitespace regular expression.
|
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
arrayBelongsTo(String[] source,
String check)
Checks if any string in the array contained in the check string.
|
static boolean |
belongsTo(String[] source,
String check)
Checks if string
check contained in the array
source . |
static boolean |
belongsTo(String str,
String belongsToStr)
Checks if string
str contained in string
belongsToStr . |
static boolean |
belongsToArray(String check,
String... values)
Checks if string belongs to array.
|
static String |
bytes2Hex(byte[] bytes)
Converts array of bytes to hex string.
|
static Object |
callAnyMethod(Object object,
String methodName,
Class<?>[] parameterTypes,
Object... params)
Dynamically calls any (including private) method
methodName
on the object object using parameters params . |
static Object |
callAnyMethod(Object object,
String methodName,
Object... params)
Dynamically calls any (including private) method
methodName
on the object object using parameters params . |
static Object |
callMethod(Object object,
String methodName,
Class<?>[] parameterTypes,
Object... params)
Dynamically calls method
methodName on the object
object using parameters params . |
static Object |
callMethod(Object object,
String methodName,
Object... params)
Dynamically calls method
methodName on the object
object using parameters params . |
static Object |
callStatic(String className,
String methodName,
Class<?>[] parameterTypes,
Object... params)
Dynamically calls static method
methodName on the class
className using parameters params . |
static Object |
callStatic(String className,
String methodName,
Object... params)
Dynamically calls static method
methodName on the class
className using parameters params . |
static String |
capFirstChar(String value)
Capitalizes first character of the string.
Examples: abc->Abc 1bc->1bc |
static String |
capitalize(String str,
char[] delimiters)
Capitalizes all the delimiter separated words in a String.
|
static int |
compareDate(Date date1,
Date date2)
Compares two dates ignoring time.
|
static int |
compareTo(Object v1,
Object v2)
Compare two objects.
|
static String |
concat(String source,
String toAdd,
String delim)
Concatenates strings.
|
static <T> T[] |
concatArrays(T[] first,
T[]... rest)
Concatenates any number of the arrays of the same type.
|
static String |
concatStrings(String delimiter,
String... values)
Concatenate strings.
|
static boolean |
containsCaseInsensitive(String value,
List<String> list)
Contains case insensitive.
|
static boolean |
containsWord(String source,
boolean caseInsensetive,
String... words)
Checks if source string contains a whole word (not a substring).
|
static String |
date2Str(Date date,
String format)
Converts Date to String.
|
static Object |
decode(Object... arg)
Similar to the Oracle decode function compares first argument to each
value one by one.
|
static Object |
decodeArray(Object[] values)
Similary to the Oracle decode function compares first element of the
array to each value one by one.
|
static boolean |
equals(Object o1,
Object o2)
Compares two objects.
|
static boolean |
equals(Object o1,
Object o2,
boolean ignoreNull)
Compares two objects.
|
static boolean |
exceptionIncludesError(Throwable ex,
String errors)
Check if exception includes any of the ;-separated errors.
|
static Process |
execScript(String cmdFileName)
Executes shell script.
|
static Process |
execScriptAndRedirect(String cmdFileName,
String log)
Execute script and redirect to the log file.
|
static String |
filter(String value,
String[] original,
String[] replaceOn)
Replaces all strings from the array
original contained in
the string value |
static String |
findAndReplace(String original,
String find,
String replace,
boolean ignoreCase)
Takes String and replaces the "find" string with the "replace" string.
|
static String |
findAndReplaceRegexp(String original,
String find,
String replace,
boolean ignoreCase)
Takes String and replaces the "find" string with the "replace" string
using regular expression.
|
static int |
findClosingBraket(char opening,
char closing,
int start,
String input) |
static String |
format(String input,
String... params)
Takes the input string and replaces all instances of %N on the
corresponding value.
|
static String |
formatBySplitting(String source,
char separator,
char eof,
boolean keepSeparator,
boolean trim,
char... quotes)
Format string by splitting using separator, ignore quotes, add eof to the
end of each line.
|
static Date |
fromMidnight(long value)
Get time from midnight.
|
static long |
getAge(Date date,
Date compareTo,
boolean isRound)
Gets the age.
|
static TypedKeyValue<String,Integer> |
getCellRef(String value)
Gets the spreadsheet cell reference.
|
static int |
getDate(Date date,
int field,
TimeZone tz)
Returns the value of the given calendar field using given TimeZone
|
static long |
getDateDiff(Date endDate,
Date startDate,
int field)
Calculates the difference between two dates using given calendar field.
|
static Date |
getDateFromEpochDays(long value)
Gets the date either as milliseconds or days from epoch.
|
static Date |
getDateFromEpochMicros(long value)
Gets the date using given number of microseconds from epoch.
|
static TimeZone |
getDefaultTimeZone()
Gets the default time zone.
|
static String |
getExceptionMessage(Throwable ex)
Gets the exception message.
|
static int |
getFirstDigits(Number value,
int numDigits)
Gets the first
numDigits digits from the number. |
static String |
getFirstWord(String input,
String wordPattren)
Get first word in the input string.
|
static String[] |
getFunctionParams(String name,
String source)
Gets the array of parameters passed to the function from the string
representing function's call.
|
static InputStream |
getInputStreamFromObject(Object value)
Converts object to the InputStream.
|
static InputStream |
getInputStreamFromString(String value)
Converts string to the InputStream.
|
static InputStream |
getInputStreamFromString(String value,
String encode)
Converts string to the InputStream.
|
static int |
getJvmType()
Checks if current JVM is 32 or 64 bit.
|
static String |
getLastWord(String input,
String wordPattren)
Get last word in the input string.
|
static List<String[]> |
getLeftAndRightWords(String input,
String delimiter,
String wordPattren)
Get the left and right words between delimiter.
|
static List<String> |
getList(String value,
String delim)
Split input string and return immutable list of strings.
|
static String |
getMessage(Throwable ex,
String delim)
Get the exception message.
|
static int |
getNumberOfRepeats(String value,
String pattern)
Gets the number of repeats of the specific string within the given input.
|
static Object |
getNumberOrStr(Object value,
Object def)
Gets the number or string.
|
static Object |
getObjectFromInputStream(InputStream is)
Gets the object from input stream.
|
static String |
getOrEvaluateRegex(Map<String,String> map,
String original,
String find)
Gets the value from the map or iterate and evaluate regexps until there
is match with find
|
static String |
getParam(String paramValue)
Gets the value of the parameter from the parameter=value string.
|
static String |
getParam(String params,
String name)
Gets the value of the parameter from the parameter=value string.
|
static String |
getParamFromMap(String name,
Map<String,String> params,
String defaultValue)
Gets the value from map of parameters using given name.
|
static String |
getParamFromString(String value,
String param)
Gets the parameter from the given string.
|
static Properties |
getProperties(String props)
Converts input string to
Properties . |
static Properties |
getPropertiesByPrefix(Properties properties,
String prefix)
Gets the properties by prefix with the specific prefix in the key.
|
static Map<String,String> |
getPropertiesMap(Map<String,String> properties,
String props,
boolean firstEqual,
char separator)
Converts input string to map of key values pairs.
|
static LinkedHashMap<String,String> |
getPropertiesMap(String props,
boolean firstEqual)
Converts input string to map of key values pairs.
|
static LinkedHashMap<String,String> |
getPropertiesMap(String props,
boolean firstEqual,
char separator)
Converts input string to map of key values pairs.
|
static String |
getPropertyAndGenerateException(Properties props,
String name)
Gets the property and generate exception if property does not exists.
|
static String |
getPropertyWithVariables(Properties props,
String name)
Gets the property value from the given properties.
|
static String |
getPropsString(Properties properties)
Gets the string formated as key1="value";key2="value" from the
properties.
|
static String[] |
getSeries(int start,
int end,
int mult)
Gets the series of of values between
start and
end using multiplier mult . |
static String[] |
getSeries(String first,
int start,
int end,
int mult)
Gets the series of of values between
start and
end using multiplier mult . |
static String |
getShellExt()
Gets the default shell script extension for the current OS.
|
static String |
getShellExt(String defaultExt)
Gets the default shell script extension for the current OS.
|
static String |
getStackTraceAsString(Throwable e)
Converts stack trace from the given Throwable to the string.
|
static String |
getStringBetweenQuotes(String value)
Trim and get the string between quotes.
|
static String |
getText(Object input)
Either returns input.getText() if getText method exists fro input or
input.toString() if it does not.
|
static String[] |
getTokens(String value,
char delimiter,
int maxTokens)
Splits
value string around matches of the given
delimiter without using regular expression. |
static List<String> |
getTokensBetweendDelims(String input,
char open,
char close)
Gets the tokens between delimiters.
|
static String[] |
getTokensRegexp(String value,
String delim)
Splits
value string around matches of the given
delimiter using regular expression. |
static String |
getUUID()
Gets the string representation of the type 4 (pseudo randomly generated)
UUID.
|
static String |
getUUIDName()
Gets the string representation of the type 4 (pseudo randomly generated)
UUID and replaces all instances of "-" on "".
|
static List<TypedKeyValue<String,String>> |
getVarAndFunction(String input)
Parses the
input string which can be in a format
key1=value,key2,key3=value ... |
static List<TypedKeyValue<String,TypedKeyValue<String,String>>> |
getVarAndFunctionAndParams(String input)
Parses the
input string which can be in a format
key1=value(params),key2,key3=value(params) ... |
static LinkedHashMap<String,TypedKeyValue<String,String>> |
getVariables(String input,
char open,
char close)
Returns a map of variables from the string.
|
static int |
getWordCount(String source,
boolean caseInsensetive,
String... words)
Get number of appearances of the given whole words (not a substring).
|
static Map<String,List<String>> |
groupByProperties(Map<String,String> properties,
String prefix,
char delim)
Group by properties by prefix using given delimiter.
|
static Map<String,List<String>> |
groupByProperties(Properties properties,
String prefix,
char delim)
Group by properties by prefix using given delimiter.
|
static byte[] |
gZipArray(byte[] value)
GZip byte array.
|
static boolean |
hasLeadingZeros(String value)
Checks for leading zeros.
|
static boolean |
hasWhitespace(String value)
Checks string for whitespaces.
|
static byte[] |
hex2Bytes(String s)
Converts hex string to the array of bytes.
|
static String |
incName(String name,
String delim,
int start)
Calculate new name by incrementing number after last delimiter.
|
static int |
indexOf(String[] source,
String check)
Get index of the string the array, ignoring whitespace.
|
static boolean |
isBoolean(String value)
Checks if string is boolean.
|
static boolean |
isDateOnly(Date date,
TimeZone tz)
Checks if given date is a date only.
|
static boolean |
isDecimal(Number value)
Checks if number is decimal.
|
static boolean |
isDowntimeException(Throwable ex)
Checks if this is a downtime exception.
|
static boolean |
isEmpty(Object object)
Checks if object is 'empty'.
|
static boolean |
isInteger(double number)
Checks if number is integer (or long).
|
static boolean |
isMac()
Checks if current OS is Mac.
|
static boolean |
isMetroUiReady()
Checks if UI is metro style ready.
|
static boolean |
isNix()
Checks if current OS is Unix or Linux.
|
static boolean |
isNothing(Object object)
Returns true if object is null, or if object.toString().trim().length()
== 0.
|
static boolean |
isNumber(String toTest)
Checks if string is number.
|
static boolean |
isParticularException(Throwable ex,
String pattern)
Checks if
ex.getMessage() contains pattern . |
static boolean |
isScientificNotation(String numberString)
Checks if string is a number in scientific notation.
|
static boolean |
isStrIn(String check,
String... strings)
Checks if gives string belongs to the given array of strings.
|
static boolean |
isTimeOnly(Date date,
TimeZone tz)
Checks if date is a time only.
|
static boolean |
isUnsignedInt(String toTest)
Checks if string is an unsigned int.
|
static boolean |
isWindows()
Checks if current OS is Windows.
|
static boolean |
lastSubstringMatch(String source,
String substr)
Check if the substring is actually the last part of the string.
|
static String |
list2Str(List<String> list,
String delim)
Convert list of strings the delimited string.
|
static Properties |
loadPropsFromClassPath(String resourceName)
Loads properties from class path.
|
static Properties |
loadPropsFromFile(String fileName)
Loads properties from the file.
|
static String |
longestCommonSubstring(String str1,
String str2)
Calculates longest common substring between two strings.
|
static String |
makeString(Object o)
Converts object to string.
|
static String |
milliseconds()
Milliseconds.
|
static Object |
nvl(Object value,
Object def)
Return passed value if not null, otherwise return def.
|
static String |
nvl(String value)
Returns either
value or ""
if (value.isNothing()) . |
static String |
nvl(String value,
String delim)
Returns either
value + delim or ""
if (value.isNothing()) . |
static String |
nvl(String value,
String replace,
String delim)
Returns either
value + delim or replace
if (value.isNothing()) . |
static InputStream |
outputStream2InputStream(ByteArrayOutputStream originalOutputStream)
Output stream 2 input stream.
|
static String |
padding(int repeat,
char padChar)
Creates a string by repeating
padChar repeat
times. |
static String |
padLeft(String value,
int n,
boolean trim)
Creates a string by adding spaces to the left of the input string until
it's length is less than
n . |
static String |
padRight(String s,
int n,
boolean trim)
Creates a string by adding spaces to the right of the input string until
it's length is less than
n . |
static List<TypedKeyValue<String,String>> |
parseComlexStructure(String input,
String start,
String end,
String delim,
String startChar,
String endChar,
boolean includesPrefix)
Parses the complex data structure which contains key-value pairs.
|
static String[] |
parseOrderByStyleString(String value,
String[] qualifiers,
String defaultQualifier)
Parses the order by style string.
|
static List<String> |
parseTemplateTokens(String template)
Parses the template tokens like [token1]_[token2]_abc_[token3]_xyz and
return an array list which contains part of the template without tokens
|
static byte[] |
readBytesFromInputStream(InputStream inputStream,
boolean closeStream)
Creates array of bytes from the input stream.
|
static String |
readStringFromInputStream(InputStream is)
Creates string from the input stream.
|
static String |
readStringFromReader(Reader r)
Creates string from reader.
|
static String |
removeEmptyLines(String s)
Removes the empty lines.
|
static String |
removeEmptySpace(String value)
Removes the empty space by calling
value.trim() . |
static String |
removeWhiteSpace(String s)
Removes the whitespace characters.
|
static String |
removeWhiteSpaceExceptBetweenQuotes(String s)
Removes the whitespace characters except onces between single and double
quotations marks.
|
static void |
setAnyField(Object object,
String fieldName,
Object value)
Sets value for any field, including private.
|
static Date |
setDate(Date date,
int value,
int field,
TimeZone tz)
Sets the value for the specific calendar field using given TimeZone.
|
static Date |
setDateToBeginningOfTime(Date date)
Sets the date to beginning of time.
|
static Set<String> |
setSplit(String toSplit,
String delim)
Splits the string using given delimiter and adds tokens to the hash set.
|
static Set<String> |
setSplit(String toSplit,
String delim,
boolean trim,
boolean toUpperCase)
Splits the string using given delimiter and adds tokens to the hash set.
|
static Date |
setTimeToMidnight(Date date)
Sets time to midnight.
|
static String |
setVarValues(String source,
LinkedHashMap<String,TypedKeyValue<String,String>> namesAndValues,
char open,
char close)
Sets the variable values.
|
static String |
smartConcat(String source,
String left,
String right,
String delim)
Concatenate string using the following algorithm:
left + delim + right . |
static String[] |
split(String source,
String delim,
int[] lengthArray)
Splits the input string using either
delim string or if
lengthArray != null && lengthArray.length > 0 lengthArray as
an array where each element is a field length. |
static String |
splitLines(List<TypedKeyValue<String,Integer>> all,
String value,
int lines,
String delim)
This method takes
value as an input string and builds
all list in a way that each element ('partition') of the
list contains not more than lines of text. |
static String[] |
splitOnEol(String value)
Split on eol.
|
static List<String> |
splitToList(String toSplit,
String delim,
boolean trim,
boolean toUpperCase)
Splits the string using given delimiter and adds tokens to the hash set.
|
static String[] |
splitWithCommaAndQuoteRemoveSpaces(String source)
Split string with quotes using comma as a separator.
|
static boolean |
str2Bool(String value,
boolean defaultValue)
Converts string to boolean.
|
static Boolean |
str2Boolean(String value,
Boolean defaultValue)
Converts string to Boolean.
|
static byte |
str2Byte(String str,
byte def)
Converts string to byte.
|
static String |
str2CsvStr(String value)
Convert string to the standard csv string.
|
static Date |
str2Date(String str,
Date def,
String format)
Converts string to date using
format string. |
static Date |
str2Date(String input,
String[] formats)
Converts string to date using array of formats.
|
static int |
str2Int(String str,
int def)
Converts string to int.
|
static Integer |
str2Integer(String str,
Integer def)
Converts string to Integer.
|
static long |
str2Long(String str,
long def)
Converts string to long.
|
static Long |
str2Long(String str,
Long def)
Converts string to Long.
|
static String |
str2Name(String value)
Converts string to the 'name' by removing whitespaces and other special
characters (such as '_').
|
static Number |
str2Number(String value,
Number defaultValue)
Converts string to Number.
|
static String |
str2PropsStr(String value,
String delim,
String quote)
Parses string like name=value;name=value and converts it to
name='value';name='value';
|
static String |
str2Regexp(String value)
Converts string with special chars used by Java regular expression engine
to the string where these chars precede by escapes character.
|
static String |
str2Str(String str,
String def)
If fiven
str is not null returns str , otherwise
returns def . |
static int |
subStrCount(String value,
String toFind)
Count number of occurrences of the toFind string inside given source
string.
|
static String |
timestamp()
Timestamp.
|
static String |
timestampdatefirst()
Timestamp date first.
|
static String |
timestampyeardatefirst()
Timestamp year first.
|
static String |
timestampyearfirst()
Timestamp year first.
|
static String |
trim(String value)
Trims string by removing all whitespaces.
|
static String |
trim(String value,
int length,
String add)
Creates a string by concatenatig
value and add
so the new string.length is <= length . |
static String |
trimLeft(String value,
int size)
Trims left part of the string so it length is <=
size . |
static String |
trimRight(String value,
int size)
Trims right part of the string so it length is <=
size . |
static String |
truncateAddSuffix(String value,
int length,
String suffix,
boolean allowOverage)
Truncate string to the max length and add suffix.
|
static String |
truncEnd(String s,
String toTrunc)
Truncates input string by removing everything after (and including)
toTrunc . |
static String |
uncapitalize(String str,
char[] delimiters)
Uncapitalizes all the whitespace separated words in a String.
|
static String |
uuid()
Uuid.
|
static InputStream |
value2InputStream(Object value)
Convert value to input stream.
|
static Object |
value2Type(String typeName,
Object value)
Convert input value to the object of the given type name.
|
static String |
whiteSpace2Space(String s)
Replace any white space char on space char.
|
static byte[] |
zipArray(byte[] value)
Zip byte array.
|
public static long EPOCH_TRESHOLD
public static final String STRING
public static final String INTEGER
public static final String LONG
public static final String NUMBER
public static final String DATE
public static final String TIME
public static final String TIMESTAMP
public static final String BOOLEAN
public static final String RADIO
public static final String LIST
public static final String WHITESPACE
public static final String NEWLINE
public static final long ONE_DAY
public static boolean arrayBelongsTo(String[] source, String check)
source
- the array of strings which might be contained i the check
string check
check
- the string to checkpublic static boolean belongsTo(String str, String belongsToStr)
str
contained in string
belongsToStr
. Case insensitive.str
- the string to checkbelongsToStr
- the string which might contain str
public static boolean belongsTo(String[] source, String check)
check
contained in the array
source
. Case insensitive. Ignores spaces.source
- the array of strings which might contain string
check
check
- the string to checkpublic static boolean belongsToArray(String check, String... values)
check
- the string to checkvalues
- the arraypublic static String bytes2Hex(byte[] bytes)
bytes
- the array of bytespublic static void setAnyField(Object object, String fieldName, Object value) throws Exception
object
- the objectfieldName
- the field namevalue
- the valueException
- in case of any errorpublic static Object callAnyMethod(Object object, String methodName, Class<?>[] parameterTypes, Object... params)
methodName
on the object object
using parameters params
.
In case of any exception returns null
.object
- the object containing method methodName
methodName
- the method name to callparameterTypes
- the parameter typesparams
- the array of parameters to pass to the methodpublic static Object callAnyMethod(Object object, String methodName, Object... params)
methodName
on the object object
using parameters params
.
In case of any exception returns null
.object
- the object containing method methodName
methodName
- the method name to callparams
- the array of parameters to pass to the methodpublic static Object callMethod(Object object, String methodName, Class<?>[] parameterTypes, Object... params)
methodName
on the object
object
using parameters params
. In case of any
exception returns null
.object
- the object containing method methodName
methodName
- the method name to callparameterTypes
- the parameter typesparams
- the array of parameters to pass to the methodpublic static Object callMethod(Object object, String methodName, Object... params)
methodName
on the object
object
using parameters params
. In case of any
exception returns null
.object
- the object containing method methodName
methodName
- the method name to callparams
- the array of parameters to pass to the methodpublic static Object callStatic(String className, String methodName, Class<?>[] parameterTypes, Object... params)
methodName
on the class
className
using parameters params
. In case of
any exception returns null
.className
- the class name of the class which contains method
methodName
methodName
- the method name to callparameterTypes
- the parameter typesparams
- the array of parameters to pass to the methodpublic static Object callStatic(String className, String methodName, Object... params)
methodName
on the class
className
using parameters params
. In case of
any exception returns null
.className
- the class name of the class which contains method
methodName
methodName
- the method name to callparams
- the array of parameters to pass to the methodpublic static String capFirstChar(String value)
value
- the input stringpublic static String capitalize(String str, char[] delimiters)
str
- the stringdelimiters
- the delimiterspublic static int compareDate(Date date1, Date date2)
date1
- the date1date2
- the date2public static int compareTo(Object v1, Object v2)
v1
- the objectv2
- the object to comparepublic static String concat(String source, String toAdd, String delim)
source
- the sourcetoAdd
- the string to adddelim
- the delimiter@SafeVarargs public static <T> T[] concatArrays(T[] first, T[]... rest)
T
- the generic typefirst
- the first arrayrest
- the rest of the arrayspublic static String concatStrings(String delimiter, String... values)
delimiter
- the delimitervalues
- the string to concatenatepublic static boolean containsWord(String source, boolean caseInsensetive, String... words)
source
- the sourcecaseInsensetive
- if true ignore casewords
- the wordspublic static String date2Str(Date date, String format)
Note that since a Timestamp inherits from java.util.Date, this method will also work on Timestamps.
Known limitation: milliseconds will print as 0 if date is a
java.sql.Timestamp
object, because of inheritance weirdness
between it and java.util.Date
. This is a reasonably easy
fix, not implemented because there's no need and it would marginally slow
the code.
For example, to display a date in the format "02/13/2001 21:45:12", use
Utils.dateToString(myDate, "MM/dd/yyyy HH:mm:ss");
date
- The date to be formatted.format
- The format being applied to this date. Specifications can be
found in SimpleDateFormat
. Alternately, you
can use one of the class variables.Timestamp
public static Object decode(Object... arg)
Utils.decode(10, 12, "a", 10, "b", "c") -> "b"
Utils.decode(10, 12, "a", 11, "b", "c") -> "c"
Utils.decode(10, 12, "a", 11, "b") -> 10
Utils.decode(10) -> 10
Utils.decode(null) -> null
arg
- any number of argumentspublic static Object decodeArray(Object[] values)
Utils.decodeArray(new Object[] {10, 12, "a", 10, "b", "c"}) -> "b"
Utils.decodeArray(new Object[] {10, 12, "a", 11, "b", "c"}) -> "c"
Utils.decodeArray(new Object[] {10, 12, "a", 11, "b"}) -> 10
Utils.decodeArray(new Object[] {10}) -> 10
Utils.decodeArray(null) -> null
values
- the valuespublic static boolean equals(Object o1, Object o2)
o1
- the first object to compareo2
- the second object to comparepublic static boolean equals(Object o1, Object o2, boolean ignoreNull)
ignoreNull == true
converts nulls
to the empty strings before comparing.o1
- the first object to compareo2
- the second object to compareignoreNull
- if true
converst null to the empty string
Utils.equals("abc", "abc", true) -> true
Utils.equals("abc", "cba", true) -> false
Utils.equals(null, "", true) -> true
Utils.equals(null, "", false) -> false
public static Process execScript(String cmdFileName) throws Exception
cmdFileName
- the shell script file nameProcess
object for managing the subprocessException
- in case of any errorpublic static Process execScriptAndRedirect(String cmdFileName, String log) throws Exception
cmdFileName
- the cmd file namelog
- the log file nameException
- the exceptionpublic static String filter(String value, String[] original, String[] replaceOn)
original
contained in
the string value
on the strings in the array replaceOn
.
Utils.filter("abc ddd mmm kkk lll", new String[] {"ddd", "kkk"}, new
String[] {"11", "22"}) -> "abc 11 mmm 22 lll"
value
- the original stringoriginal
- the array of strings to searchreplaceOn
- the array of strings to replace onpublic static String findAndReplace(String original, String find, String replace, boolean ignoreCase)
original
- the original stringfind
- the string to searchreplace
- the string to replace onignoreCase
- if true
the case of all characters is ignored
during searchpublic static String findAndReplaceRegexp(String original, String find, String replace, boolean ignoreCase)
original
- the original stringfind
- the string to search. Can be a regular expressionreplace
- the string to replace onignoreCase
- if true
the case of all characters is ignored
during searchpublic static String format(String input, String... params)
Utils.format("file %1 and file %2", "abc", "xyz") - > "file abc and file xyz"
Utils.format("file aaa and file bbb", "abc", "xyz") - > "file aaa and file bbb"
input
- the input Stringparams
- the array of parameterspublic static String formatBySplitting(String source, char separator, char eof, boolean keepSeparator, boolean trim, char... quotes)
source
- the sourceseparator
- the separatoreof
- the end-of-line characterkeepSeparator
- the if true - keep separator in the stringtrim
- the if true - trim substringsquotes
- the quotespublic static long getAge(Date date, Date compareTo, boolean isRound)
date
- the datecompareTo
- the compare to dateisRound
- if true round age to yearspublic static TypedKeyValue<String,Integer> getCellRef(String value)
AA14 -> AA - 14
value
- the valuepublic static int getDate(Date date, int field, TimeZone tz)
Utils.getDate(Utils.str2Date("01/02/2010", null, "MM/dd/yyyy"), Calendar.YEAR, null) -- 2010
date
- the datefield
- the calendar field (Calendar.DATE, Calendar.YEAR, etc)tz
- the time zonepublic static long getDateDiff(Date endDate, Date startDate, int field)
Utils.getDateDiff(Utils.str2Date("01/02/2012", null, "MM/dd/yyyy"), Utils.str2Date("01/02/2010", null, "MM/dd/yyyy"), Calendar.YEAR) -- 2
endDate
- the end datestartDate
- the start datefield
- the calendar field (Calendar.DATE, Calendar.YEAR, etc)public static TimeZone getDefaultTimeZone()
public static int getFirstDigits(Number value, int numDigits)
numDigits
digits from the number.value
- the valuenumDigits
- the nummber of digitspublic static String[] getFunctionParams(String name, String source)
Utils.getFunctionParams("abc", "abc(1,2,3)") -> {1, 2, 3}
name
- the name of the functionsource
- the string representing function's callpublic static InputStream getInputStreamFromObject(Object value) throws IOException
value
- the object to serializeIOException
- Signals that an I/O exception has occurred.public static InputStream value2InputStream(Object value) throws Exception
value
- the valueException
- the exceptionpublic static Object getObjectFromInputStream(InputStream is) throws Exception
is
- the input streamException
- in case of any errorpublic static InputStream getInputStreamFromString(String value) throws IOException
value
- String to convertIOException
- Signals that an I/O exception has occurred.public static InputStream getInputStreamFromString(String value, String encode) throws IOException
value
- String to convertIOException
- Signals that an I/O exception has occurred.public static int getJvmType()
public static List<String> getList(String value, String delim)
value
- the input stringdelim
- the delimiterpublic static String getMessage(Throwable ex, String delim)
ex
- the exceptiondelim
- the delimiterpublic static boolean exceptionIncludesError(Throwable ex, String errors)
ex
- the Throwableerrors
- the ;-separated errorspublic static Object getNumberOrStr(Object value, Object def)
value
- the input valuedef
- the defaultpublic static String getParam(String paramValue)
Utils.getParam("abc=aaa") -> "aaa"
paramValue
- the parameter=value stringpublic static String getParam(String params, String name)
Utils.getParam("abc=aaa;xyz=123;fff=777", "xyz") -> "123"
params
- the parameter=value stringname
- the name of the parameterpublic static String getParamFromMap(String name, Map<String,String> params, String defaultValue)
defaultValue
.name
- the name of the parameterparams
- the map of the parametersdefaultValue
- the default valuedefaultValue
.public static String getParamFromString(String value, String param)
Utils.getParamFromString("Error at the line 123 and column 17", "at the line") -- 123
value
- the stringparam
- the parameter namepublic static Properties getProperties(String props)
Properties
. The format of the
string: name1=value1;name2=value2;etc
Utils.getProperties("abc=aaa;xyz=123")
props
- the input stringpublic static LinkedHashMap<String,String> getPropertiesMap(String props, boolean firstEqual)
Utils.getPropertiesMap("abc=aaa;xyz=123")
props
- the input stringfirstEqual
- if true ignore all "=" after firstpublic static LinkedHashMap<String,String> getPropertiesMap(String props, boolean firstEqual, char separator)
Utils.getPropertiesMap("abc=aaa;xyz=123")
props
- the input stringfirstEqual
- if true ignore all "=" after firstseparator
- the separator between key-value pairspublic static Map<String,String> getPropertiesMap(Map<String,String> properties, String props, boolean firstEqual, char separator)
Utils.getPropertiesMap("abc=aaa;xyz=123")
properties
- the propertiesprops
- the input stringfirstEqual
- if true ignore all "=" after firstseparator
- the separator between key-value pairspublic static String getPropertyWithVariables(Properties props, String name)
props
- the propertiesname
- the namepublic static String[] getSeries(int start, int end, int mult)
start
and
end
using multiplier mult
.
Utils.getSeries(1, 5, 10) - > {"10", "20", "30", "40", "50"}
start
- the start valueend
- the end valuemult
- the multiplierpublic static String[] getSeries(String first, int start, int end, int mult)
start
and
end
using multiplier mult
. If
first != null
adds it as a first element of the output
array.
Utils.getSeries(null, 1, 5, 10) - > {"10", "20", "30", "40", "50"}
Utils.getSeries("0", 1, 5, 10) - > {"0", "10", "20", "30", "40", "50"}
first
- the String which if not null will be added as as first element
of the output array.start
- the start valueend
- the end valuemult
- the multiplierpublic static String getShellExt()
public static String getShellExt(String defaultExt)
defaultExt != null
returns defaultExtdefaultExt
- the default extpublic static String getStackTraceAsString(Throwable e)
e
- the Throwablepublic static String getExceptionMessage(Throwable ex)
ex
- the exceptionpublic static String getText(Object input)
input
- the inputpublic static String[] getTokens(String value, char delimiter, int maxTokens)
value
string around matches of the given
delimiter
without using regular expression.
The maxTokens parameter controls the number of times the pattern is applied and therefore affects the length of the resulting array. If the maxTokens n is greater than zero then the the pattern will be applied at most n - 1 times, the array's length will be no greater than n, and the array's last entry will contain all input beyond the last matched delimiter. If n is non-positive then the pattern will be applied as many times as possible and the array can have any length. If n is zero then the pattern will be applied as many times as possible, the array can have any length, and trailing empty strings will be discarded.
value
- the valuedelimiter
- the delimitermaxTokens
- the max tokenspublic static String[] getTokensRegexp(String value, String delim)
value
string around matches of the given
delimiter
using regular expression. If value
is
null or value.length == 0
returns empty array.value
- the string to splitdelim
- the delimeterpublic static String getUUID()
public static String getUUIDName()
public static LinkedHashMap<String,TypedKeyValue<String,String>> getVariables(String input, char open, char close)
input
- the input stringopen
- the open bracketclose
- the close bracketpublic static int getWordCount(String source, boolean caseInsensetive, String... words)
source
- the sourcecaseInsensetive
- if true ignore casewords
- the wordspublic static Properties getPropertiesByPrefix(Properties properties, String prefix)
properties
- the input propertiesprefix
- the prefixpublic static String getPropsString(Properties properties)
properties
- the propertiespublic static Map<String,List<String>> groupByProperties(Map<String,String> properties, String prefix, char delim)
Utils.getPropKeysByPattern("extract", '.') - > test: extract.test.cron, extract.test.orders, extract.test.ietms...
properties
- the propertiesprefix
- the prefixdelim
- the delimiterpublic static Map<String,List<String>> groupByProperties(Properties properties, String prefix, char delim)
Utils.getPropKeysByPattern("extract", '.') - > test: extract.test.cron, extract.test.orders, extract.test.ietms...
properties
- the propertiesprefix
- the prefixdelim
- the delimiterpublic static byte[] gZipArray(byte[] value) throws IOException
value
- byte array to gzipIOException
- in case of any errorpublic static boolean hasLeadingZeros(String value)
value
- the valuepublic static boolean hasWhitespace(String value)
value
- the string to checkpublic static byte[] hex2Bytes(String s)
s
- the input stringpublic static String incName(String name, String delim, int start)
abc -> abc_1
abc_1 -> abc_2
name
- the namedelim
- the delimiterstart
- the start numberpublic static int indexOf(String[] source, String check)
source
- the sourcecheck
- the checkpublic static boolean isBoolean(String value)
Possible values (case insensitive): Y,N,YES,NO,TRUE,FALSE
value
- the string to checkpublic static boolean isDateOnly(Date date, TimeZone tz)
date
- the datetz
- the time zonepublic static boolean isDecimal(Number value)
value
- the number to checkpublic static boolean isDowntimeException(Throwable ex)
ex
- the exception to checkpublic static boolean isEmpty(Object object)
object
- the object to checkpublic static boolean isInteger(double number)
number
- the numberpublic static boolean isMac()
public static boolean isMetroUiReady()
public static boolean isNix()
public static boolean isNothing(Object object)
object
- the object to checkpublic static boolean isNumber(String toTest)
toTest
- the string to checkpublic static boolean isParticularException(Throwable ex, String pattern)
ex.getMessage()
contains pattern
.ex
- the exeption to checkpattern
- the patternpublic static boolean isStrIn(String check, String... strings)
check
- the string to checkstrings
- the array of stringspublic static boolean isTimeOnly(Date date, TimeZone tz)
date
- the datetz
- the time zonepublic static boolean isUnsignedInt(String toTest)
toTest
- the string to heckpublic static boolean isWindows()
public static Properties loadPropsFromClassPath(String resourceName) throws IOException
resourceName
- the resource nameIOException
- Signals that an I/O exception has occurred.public static Properties loadPropsFromFile(String fileName) throws IOException
fileName
- the file nameIOException
- Signals that an I/O exception has occurred.public static String longestCommonSubstring(String str1, String str2)
longestCommonSubstring("fsdfdgfdgfsdabsfgdshhghg", "34546654654abc657876876687") -- "ab"
Utils.longestCommonSubstring("dfgfgdgfd 123 456 fsdfdsfdssfdfsd", "h12123 456789543453453") -- "123 456"
str1
- the stringstr2
- the stringpublic static String makeString(Object o)
o.toString()
or ""
if o == null || o.toString() == null
.o
- the input objectpublic static Object nvl(Object value, Object def)
value
- the valuedef
- the default valuepublic static String nvl(String value)
value
or ""
if (value.isNothing())
.value
- the input stringpublic static String nvl(String value, String delim)
value + delim
or ""
if (value.isNothing())
.value
- the input stringdelim
- the string to add to the valuepublic static String nvl(String value, String replace, String delim)
value + delim
or replace
if (value.isNothing())
.value
- the input stringreplace
- the string to replace value ondelim
- the string to add to the valuepublic static String padding(int repeat, char padChar) throws IndexOutOfBoundsException
padChar
repeat
times.repeat
- the number of repeatspadChar
- the char to repeatIndexOutOfBoundsException
- if repeat
is negativepublic static String padLeft(String value, int n, boolean trim)
n
. If trim == true
trims string to the n
chars.
Utils.padLeft("abc", 5, false) -> " abc"
Utils.padLeft("", 5, false) -> " "
Utils.padLeft("abcdef", 5, true) -> "abcde"
value
- the input stringn
- the max length of the stringtrim
- if true
trims string to the n
chars.public static String padRight(String s, int n, boolean trim)
n
. If trim == true
trims string to the n
chars.
Utils.padRight("abc", 5, false) -> "abc "
Utils.padRight("", 5, false) -> " "
Utils.padRight("abcdef", 5, true) -> "abcde"
s
- the input stringn
- the max length of the stringtrim
- if true
trims string to the n
chars.public static List<TypedKeyValue<String,String>> parseComlexStructure(String input, String start, String end, String delim, String startChar, String endChar, boolean includesPrefix)
Example: Input: {s:15:"key1";s:30:"value1";s:22:"key2";s:11:"value2";s:13:"key3";s:7:"value3"} Output: key1/value,ley2/value2,key3/value3
input
- the input stringstart
- the strucuture start characterend
- the strucuture end characterdelim
- the delimimiterstartChar
- the start charendChar
- the end charincludesPrefix
- true if data structure includes prefix, for example
a:31:{data...}public static String[] parseOrderByStyleString(String value, String[] qualifiers, String defaultQualifier)
Utils.parseOrderByStyleString("abc desc", new String[] {"ASK, DESC"}, "ASK") -> {"abc", "ASK"}
value
- the valuequalifiers
- the qualifiersdefaultQualifier
- the default qualifierpublic static byte[] readBytesFromInputStream(InputStream inputStream, boolean closeStream) throws IOException
inputStream
- the input streamcloseStream
- if true
closes inputStreamIOException
- Signals that an I/O exception has occurred.public static String readStringFromInputStream(InputStream is) throws IOException
is
- the input streamIOException
- Signals that an I/O exception has occurred.public static String readStringFromReader(Reader r) throws IOException
r
- the readerIOException
- Signals that an I/O exception has occurred.public static String removeEmptyLines(String s)
s
- the input stringpublic static String removeEmptySpace(String value)
value.trim()
. Returns
null if value == null
.value
- the input stringpublic static String removeWhiteSpace(String s)
Utils.removeWhiteSpace(" abc dsadsa sdadsa 123 ") -> "abc dsadsa sdadsa 123"
s
- the input stringpublic static String removeWhiteSpaceExceptBetweenQuotes(String s)
Utils.removeWhiteSpaceExceptBetweenQuotes(" abc "dsa dsa" sdadsa 123 ") -> "abc "dsa dsa" sdadsa 123"
s
- the input stringpublic static Date setDate(Date date, int value, int field, TimeZone tz)
Date date = new Date(); Utils.getDate(Utils.setDate(date, 1997, Calendar.YEAR, null), Calendar.YEAR, null) -> 1997
date
- the input datevalue
- the valuefield
- the calendar field (Calendar.YEAR, Calendar.DATE, etc)tz
- the time zonepublic static Date setDateToBeginningOfTime(Date date)
date
- the datepublic static Set<String> setSplit(String toSplit, String delim)
toSplit
- the string to spllitdelim
- the delimiterpublic static Set<String> setSplit(String toSplit, String delim, boolean trim, boolean toUpperCase)
toSplit
- the string to spllitdelim
- the delimitertrim
- boolean if true trim the stringstoUpperCase
- boolean, if true convert to upper casepublic static List<String> splitToList(String toSplit, String delim, boolean trim, boolean toUpperCase)
toSplit
- the string to spllitdelim
- the delimitertrim
- boolean if true trim the stringstoUpperCase
- boolean, if true convert to upper casepublic static Date setTimeToMidnight(Date date)
date
- the datepublic static String setVarValues(String source, LinkedHashMap<String,TypedKeyValue<String,String>> namesAndValues, char open, char close)
Example: setVarValues("jdbc:oracle:thin:@//: / ", "port", "1521", '<', '>'); -- "jdbc:oracle:thin:@// :1521/ "
source
- the sourcenamesAndValues
- the names and valuesopen
- the openclose
- the closepublic static String[] split(String source, String delim, int[] lengthArray)
delim
string or if
lengthArray != null && lengthArray.length > 0
lengthArray as
an array where each element is a field length. Used to parse special char
separated or fixed length data files.
Utils.split("123;456;789", ";", null) -> {"123", "456", "789"}
Utils.split("123 456 789 ", null, int[] {4, 6, 5}) -> {"123", "456", "789"}
Utils.split("123 456 789 ", null, int[] {4, 6, 2}) -> {"123", "456", "78"}
source
- the input stringdelim
- the delimiterlengthArray
- the array ofpublic static String[] splitWithCommaAndQuoteRemoveSpaces(String source)
source
- the source stringpublic static String splitLines(List<TypedKeyValue<String,Integer>> all, String value, int lines, String delim)
value
as an input string and builds
all
list in a way that each element ('partition') of the
list contains not more than lines
of text.
delim
is used as an line separator. If
lines <= 0
the all
list will contain only
single element consist of all previously added values.all
- the list of text partitionsvalue
- the input stringlines
- the maximum number of lines in each partitiondelim
- the line delimitervalue
public static boolean str2Bool(String value, boolean defaultValue)
defaultValue
.
Possible input values (case insensitive): : Y,N,YES,NO,TRUE,FALSE,1,0
value
- the input stringdefaultValue
- the default valuepublic static Boolean str2Boolean(String value, Boolean defaultValue)
defaultValue
.
Possible input values (case insensitive): : Y,N,YES,NO,TRUE,FALSE,1,0
value
- the input stringdefaultValue
- the default valuepublic static byte str2Byte(String str, byte def)
def
.str
- the input stringdef
- the default valuepublic static String str2CsvStr(String value)
value
- the inputpublic static Date str2Date(String str, Date def, String format)
format
string. If there is an
error or input value is null returns def
.str
- the input stringdef
- the default valueformat
- The format being applied to the formatter. Specifications can
be found in SimpleDateFormat
.public static Date str2Date(String input, String[] formats)
ParseException
. Additionally it will double check result by
comparing input string with the
Utils.date2Str(result, format)
. If there is no match returns
null.input
- the inputformats
- the formatspublic static int str2Int(String str, int def)
def
.str
- the input stringdef
- the default valuepublic static Integer str2Integer(String str, Integer def)
def
.str
- the input stringdef
- the default valuepublic static long str2Long(String str, long def)
def
.str
- the input stringdef
- the default valuepublic static Long str2Long(String str, Long def)
def
.str
- the input stringdef
- the default valuepublic static String str2Name(String value)
Utils.str2Name("test") -> "test"
Utils.str2Name("test.xml") -> "testxml"
Utils.str2Name(" te st ") -> "test"
Utils.str2Name("-te___st---") -> "test"
Utils.str2Name("test/123/abc") -> "test123abc"
value
- the input stringpublic static Number str2Number(String value, Number defaultValue)
def
.
Utils.str2Number("11.23", null) -> 11.23
Utils.str2Number("11", null) -> 11
value
- the valuedefaultValue
- the default valuepublic static String list2Str(List<String> list, String delim)
list
- the listdelim
- the delimiterpublic static String str2PropsStr(String value, String delim, String quote)
Utils.str2PropsStr("abc=aaa;xyz=123;fff=777;xyz=mmm", ";", "'") -> "abc='aaa';xyz='123';fff='777';xyz='mmm';"
value
- the input stringdelim
- the delimeterquote
- the character used a quotepublic static String str2Regexp(String value)
Utils.str2Regexp("567") -> "567"
Utils.str2Regexp("\\s+str") -> "\\s\\+str"
value
- input stringpublic static String str2Str(String str, String def)
str
is not null returns str
, otherwise
returns def
.str
- the stringdef
- the default valuepublic static int subStrCount(String value, String toFind)
value
- the source stringtoFind
- the string to findpublic static String timestamp()
public static String timestampdatefirst()
public static String timestampyearfirst()
public static String timestampyeardatefirst()
public static String trim(String value)
Utils.trim(" this is a string ") -> "thisisastring"
value
- the input stringpublic static String trim(String value, int length, String add)
value
and add
so the new string.length is <= length
.
Utils.trim("abcd123", 4, null) -> "abcd" Utils.trim("abcd123", 4, "xyz") -> "axyz"
value
- the input stringlength
- the length of the result stringadd
- the string to addpublic static String trimLeft(String value, int size)
size
.
Utils.trimLeft("1234567", 3) -> "567"
value
- the input stringsize
- the size of the new stringpublic static String trimRight(String value, int size)
size
.
Utils.trimRight("1234567", 3) -> "123"
Utils.trimRight("1234567", 20) -> "1234567"
value
- the input stringsize
- the size of the new stringpublic static String truncEnd(String s, String toTrunc)
toTrunc
.
Utils.truncEnd("abc\n", "\n") -> "abc" Utils.truncEnd("xyz", "m") - > "xyz"
s
- the input stringtoTrunc
- substing to truncatepublic static List<String[]> getLeftAndRightWords(String input, String delimiter, String wordPattren)
input
- String, the input stringdelimiter
- String, the delimiterpublic static String getLastWord(String input, String wordPattren)
input
- String, the input stringwordPattren
- String, the word mathing patternpublic static String getFirstWord(String input, String wordPattren)
input
- String, the input stringwordPattren
- String, the word mathing patternpublic static String uncapitalize(String str, char[] delimiters)
str
- the stringdelimiters
- the delimiterspublic static String uuid()
public static String milliseconds()
public static Object value2Type(String typeName, Object value)
typeName
- the type namevalue
- the input valuepublic static String whiteSpace2Space(String s)
s
- the input stringpublic static byte[] zipArray(byte[] value) throws IOException
value
- byte array to zipIOException
- n case of any errorpublic static String smartConcat(String source, String left, String right, String delim)
left + delim + right
.
Example 1: Utils.smartConcat("file1 TO file2", "abc.txt", "xyz.txt", " TO ") = "abc.txt TO xyz.txt" Example 2: Utils.smartConcat("file1 TO file2", "abc.txt", null, " TO ") = "abc.txt TO file2" Example 3: Utils.smartConcat("file1 TO file2", null, "xyz.txt", " TO ") = "file1 TO xyz.txt"
source
- the sourceleft
- the leftright
- the rightdelim
- the delimiterpublic static int getNumberOfRepeats(String value, String pattern)
value
- the inputpattern
- the patternpublic static int findClosingBraket(char opening, char closing, int start, String input)
public static String getStringBetweenQuotes(String value)
value
- the valuepublic static InputStream outputStream2InputStream(ByteArrayOutputStream originalOutputStream) throws Exception
originalOutputStream
- the original output streamException
- the exceptionpublic static boolean isScientificNotation(String numberString)
numberString
- the number stringpublic static String getPropertyAndGenerateException(Properties props, String name) throws Exception
props
- the propertiesname
- the propertyexception
- the exceptionException
- the exceptionpublic static List<String> getTokensBetweendDelims(String input, char open, char close)
input
- the inputopen
- the open delimiterclose
- the close delimiterpublic static List<TypedKeyValue<String,String>> getVarAndFunction(String input)
input
string which can be in a format
key1=value,key2,key3=value
... Returns the list of key-value
pairs where the key is a variable name and the value is either function
name or nullinput
- the inputpublic static List<TypedKeyValue<String,TypedKeyValue<String,String>>> getVarAndFunctionAndParams(String input)
input
string which can be in a format
key1=value(params),key2,key3=value(params)
... Returns the
list of key-value pairs where the key is a variable name and the value is
a function and parametersinput
- the inputpublic static List<String> parseTemplateTokens(String template)
[token1]_[token2]_abc_[token3]_xyz -> [token1,_,token2,_abc_,token3,_xyz]
template
- the templatepublic static boolean lastSubstringMatch(String source, String substr)
source
- the sourcesubstr
- the substringpublic static String getOrEvaluateRegex(Map<String,String> map, String original, String find)
map
- the maporiginal
- the originalfind
- the namepublic static Date getDateFromEpochDays(long value)
value
- the valuepublic static Date fromMidnight(long value)
value
- the valuepublic static Date getDateFromEpochMicros(long value)
value
- the valuepublic static boolean containsCaseInsensitive(String value, List<String> list)
value
- the valuel
- the lpublic static String[] splitOnEol(String value)
value
- the valuepublic static String truncateAddSuffix(String value, int length, String suffix, boolean allowOverage)
value
- the input stringlength
- the max lengthsuffix
- the suffixallowOverage
- if true allow overage with suffixCopyright © 2010-2020 Toolsverse. All Rights Reserved.