BaseApi (Basic APIs)
Convert a map object to a json formatted string.
BaseApi.asJSONPrettyString(Object obj)
Parameters
obj: the object (can be a hashmap)
Returns
the formatted string
Convert map object to a json string without formatting.
BaseApi.asJSONString(Object obj)
Parameters
obj: object
Returns
the json string
Convert a json string to a map object.
BaseApi.fromJSONString(String json)
Parameters
json: string representation of json
Returns
constructed hashmap
Convert a json string as a linked hashmap. The map can be interpreted later on.
BaseApi.fromJSONStringAsArray(String json)
Parameters
json: string representation of json
Returns
the array of json objects
Read the JSON from a file name located in a specific directory. It is converted into an map object.
BaseApi.readJSON(String dir, String fileName)
Parameters
dir: the directory
fileName: name of the file
Returns
json document object
Write a map object into a file located on a specific directory.
BaseApi.writeJSON(String dir, String fileName, Object obj)
Parameters
dir: directory
fileName: name of the file
obj: json document object
Returns
result of the operation
Write a map object into a file located on a specific directory. The JSON information is a formatted inside the file.
BaseApi.writePrettyJSON(String dir, String fileName, Object obj)
Parameters
dir: directory
fileName: name of the file
obj: json formatted document
Returns
result of the operation
Build and return a successful result map object.
BaseApi.successResult()
or
BaseApi.successResult(String msg)
or
BaseApi.successResult(String msg, Object data)
Parameters
msg message to be sent
data
Returns
result of the operation
Build and return an error result map object.
BaseApi.errorResult(String msg)
or
BaseApi.errorResult(String msg, int code)
Parameters
msg: message to be sent
code: return code
Returns
the result of the operation
Extract the message from the result object. The result object has a detailed message in it therefore it will be returned.
BaseApi.extractMessage(Object obj)
Parameters
obj: object as a hashmap
Returns
message string
Checking whether the object is a result object.
BaseApi.isResult(Object obj)
Parameters
obj: the object as a hashmap
Returns
status of the result
Checking if result object is a valid one or a just a NuLL
BaseApi.isResultOrNull(Object obj)
Parameters
obj: the object as a hashmap
Returns
the status of the result
Generate a UUID sequence.
BaseApi.UUID()
Parameters
none
Returns
the uuid
Extract class name from an input string.
BaseApi.uidToClassName(String uid)
Parameters
uid: the className id
Returns
the class name
Extract an long id number from a string UID.
BaseApi.uidToId(String uid)
Parameters
uid:
Returns
Retrieves the ID as a string from uid.
BaseApi.uidToIdStr(String uid)
Parameters
uid:
Returns
Wait for certain MS given as a long number. It is a blocking function call.
BaseApi.waitForMillis(long tm)
Parameters
tm:
Returns
// Basic Description //
BaseApi.remoteCall(String javaClassName, String javaMethodName, Object... args)
Parameters
javaClassName
javaMethodName
// Some code
// Description //
BaseApi.remoteCallAsResult(String javaClassName, String javaMethodName, Object... args)
javaClassName
javaMethodName
// Some code
// Description //
BaseApi.remoteCallAsMap(String javaClassName, String javaMethodName, Object... args)
javaClassName
javaMethodName
// Some code
// Description //
BaseApi.remoteCallAsString(String javaClassName, String javaMethodName, Object... args)
javaClassName
javaMethodName
// Some code
// Description //
BaseApi.remoteCallAsList(String javaClassName, String javaMethodName, Object... args)
javaClassName
javaMethodName
// Some code
// Description //
BaseApi.remoteCallAsListOfMaps(String javaClassName, String javaMethodName, Object... args)
javaClassName
javaMethodName
// Some code
Last modified 1yr ago