Package com.jk.core.util
Class JK
java.lang.Object
com.jk.core.util.JK
The Class JK.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addToSystemConfig
(String generalSystemPropertiesPrefix, JKConfig prop) Adds the to system config.static void
addToSystemConfig
(String prefix, Properties prop) Adds the to system config.static String
buildToString
(Object... params) Builds the to string.static void
checkMe()
Check me.static void
close
(InputStream in) Close.static String
Concat.static String
Csv.static void
debug()
Debug.static void
Debug.static void
Error.static void
Exception.static boolean
Exists.static <T> T
First.static void
fixMe()
Fix me.static void
Fix me.static String
get()
Gets the.static String
Gets the app name.static String
Gets the builds the time.static Class<?>
Gets the class.static InputStream
getInputStream
(String fileName) Gets the input stream.static String
Gets the load time.Gets the messages cache.static String
getProperty
(String name) Gets the property.static String
getProperty
(String name, String defaultValue) Gets the property.static Reader
Gets the reader.protected static Scanner
Gets the scanner.static int
Gets the size.static URL
Gets the url.static Class<?>
getWrapperForPrimitive
(Class<?> clas) Gets the wrapper for primitive.static void
Handle.static void
Implement me.static void
implementMe
(String msg) Implement me.static void
init()
Inits the.protected static void
initInfo()
*.static boolean
Checks if is debug mode.static boolean
Checks if is multi tenant app.static boolean
isPrimitive
(Class<?> type) Checks if is primitive.static boolean
Checks if is test context.static void
line()
Line.static void
Log.static void
The main method.static <T> T
newInstance
(Class<T> class1) New instance.static <T> T
newInstance
(String className) New instance.static <T> List<T>
newInstances
(Class<T> clas, int count) New instances.static void
Not needed any more.static void
Not null.static void
Prints the.static void
Prints the.static void
Prints the.static void
Prints the.static void
printBlock
(Object... params) Prints the block.static void
Prints the once.static void
Prints the stack trace.static int
Random number.static int
randomNumber
(int min, int max) Random number.static char[]
readPassword
(String msg) Read password.static String
readString
(String msg) Read string.static void
restart()
Restart.static void
Run async.static void
setAppName
(String appName) Sets the app name.static void
setDebugMode
(boolean debugMode) Sets the debug mode.static void
setDefaultLocale
(JKLocale locale) Sets the default locale.static void
setMultiTenantApp
(boolean multiTenantApp) Sets the multi tenant app.static void
Sets the test context.static void
sleep
(int millis) Sleep.static void
testMe()
Test me.static void
Test me.static RuntimeException
Throww.static void
Throww.static int
To int.static <T> List<T>
toList
(T... objects) To list.To map.static Map
To map.static Set<?>
To set.static Class<?>
Type.
-
Field Details
-
NEW_LINE
The Constant NEW_LINE. -
FIELD_SEPARATOR
The Constant FIELD_SEPARATOR.- See Also:
-
CSV_SEPARATOR
The Constant CSV_SEPARATOR.- See Also:
-
FILE_SEPRATOR
The Constant FILE_SEPRATOR. -
DEFAULT_LOCALE
The default locale.
-
-
Constructor Details
-
JK
public JK()
-
-
Method Details
-
debug
public static void debug()Debug. -
error
Error.- Parameters:
format
- the formatparams
- the params
-
print
Prints the.- Parameters:
params
- the params
-
print
Prints the.- Parameters:
prop
- the prop
-
print
Prints the.- Parameters:
name
- the namelist
- the list
-
print
Prints the.- Parameters:
name
- the namemap
- the map
-
buildToString
Builds the to string.- Parameters:
params
- the params- Returns:
- the string
-
concat
Concat.- Parameters:
params
- the params- Returns:
- the string
-
handle
Handle.- Parameters:
t
- the t
-
line
public static void line()Line. -
printBlock
Prints the block.- Parameters:
params
- the params
-
throww
Throww.- Parameters:
t
- the t- Returns:
- the runtime exception
-
toMap
To map.- Parameters:
keys
- the keysvalues
- the values- Returns:
- the map
-
main
The main method.- Parameters:
args
- the arguments
-
randomNumber
public static int randomNumber()Random number.- Returns:
- the int
-
randomNumber
public static int randomNumber(int min, int max) Random number.- Parameters:
min
- the minmax
- the max- Returns:
- the int
-
getInputStream
Gets the input stream.- Parameters:
fileName
- the file name- Returns:
- the input stream
-
newInstance
New instance.- Type Parameters:
T
- the generic type- Parameters:
className
- the class name- Returns:
- the t
-
setDefaultLocale
Sets the default locale.- Parameters:
locale
- the new default locale
-
restart
public static void restart()Restart. -
exception
Exception.- Parameters:
message
- the message
-
implementMe
public static void implementMe()Implement me. -
notNeededAnyMore
public static void notNeededAnyMore()Not needed any more. -
printStackTrace
public static void printStackTrace()Prints the stack trace. -
notNull
Not null.- Parameters:
object
- the object
-
isDebugMode
public static boolean isDebugMode()Checks if is debug mode.- Returns:
- true, if is debug mode
-
log
Log.- Parameters:
format
- the formatvalues
- the values
-
debug
Debug.- Parameters:
format
- the formatvalues
- the values
-
csv
Csv.- Parameters:
msgs
- the msgs- Returns:
- the string
-
addToSystemConfig
Adds the to system config.- Parameters:
prefix
- the prefixprop
- the prop
-
readString
Read string.- Parameters:
msg
- the msg- Returns:
- the string
-
getScanner
Gets the scanner.- Returns:
- the scanner
-
readPassword
Read password.- Parameters:
msg
- the msg- Returns:
- the char[]
-
printOnce
Prints the once.- Parameters:
msg
- the msg
-
getMessagesCache
Gets the messages cache.- Returns:
- the messages cache
-
fixMe
public static void fixMe()Fix me. -
fixMe
Fix me.- Parameters:
msg
- the msg
-
testMe
public static void testMe()Test me. -
testMe
Test me.- Parameters:
message
- the message
-
checkMe
public static void checkMe()Check me. -
getReader
Gets the reader.- Parameters:
fileName
- the file name- Returns:
- the reader
-
getURL
Gets the url.- Parameters:
path
- the path- Returns:
- the url
-
exists
Exists.- Parameters:
fileName
- the file name- Returns:
- true, if successful
-
getAppName
Gets the app name.- Returns:
- the app name
-
throww
Throww.- Parameters:
e
- the emsg
- the msg
-
close
Close.- Parameters:
in
- the in
-
sleep
public static void sleep(int millis) Sleep.- Parameters:
millis
- the millis
-
implementMe
Implement me.- Parameters:
msg
- the msg
-
getWrapperForPrimitive
Gets the wrapper for primitive.- Parameters:
clas
- the clas- Returns:
- the wrapper for primitive
-
isPrimitive
Checks if is primitive.- Parameters:
type
- the type- Returns:
- true, if is primitive
-
type
Type.- Parameters:
clasName
- the clas name- Returns:
- the class
-
getClass
Gets the class.- Parameters:
className
- the class name- Returns:
- the class
-
newInstance
New instance.- Type Parameters:
T
- the generic type- Parameters:
class1
- the class 1- Returns:
- the t
-
isTestContext
public static boolean isTestContext()Checks if is test context.- Returns:
- true, if is test context
-
setTestContext
public static void setTestContext()Sets the test context. -
addToSystemConfig
Adds the to system config.- Parameters:
generalSystemPropertiesPrefix
- the general system properties prefixprop
- the prop
-
toMap
To map.- Parameters:
list
- the list- Returns:
- the map
-
toList
To list.- Type Parameters:
T
- the generic type- Parameters:
objects
- the objects- Returns:
- the list
-
isMultiTenantApp
public static boolean isMultiTenantApp()Checks if is multi tenant app.- Returns:
- true, if is multi tenant app
-
setMultiTenantApp
public static void setMultiTenantApp(boolean multiTenantApp) Sets the multi tenant app.- Parameters:
multiTenantApp
- the new multi tenant app
-
setAppName
Sets the app name.- Parameters:
appName
- the new app name
-
setDebugMode
public static void setDebugMode(boolean debugMode) Sets the debug mode.- Parameters:
debugMode
- the new debug mode
-
toSet
To set.- Parameters:
obj
- the obj- Returns:
- the sets the
-
init
public static void init()Inits the. -
initInfo
protected static void initInfo()*. -
newInstances
New instances.- Type Parameters:
T
- the generic type- Parameters:
clas
- the clascount
- the count- Returns:
- the list
-
first
First.- Type Parameters:
T
- the generic type- Parameters:
list
- the list- Returns:
- the t
-
getProperty
Gets the property.- Parameters:
name
- the name- Returns:
- the property
-
getProperty
Gets the property.- Parameters:
name
- the namedefaultValue
- the default value- Returns:
- the property
-
getBuildTime
Gets the builds the time.- Returns:
- the builds the time
-
get
Gets the.- Returns:
- the string
-
getLoadTime
Gets the load time.- Returns:
- the load time
-
runAsync
Run async.- Parameters:
runnable
- the runnable
-
toInt
To int.- Parameters:
obj
- the obj- Returns:
- the int
-
getSize
Gets the size.- Parameters:
c
- the c- Returns:
- the size
-