BaseApi (Basic APIs)

asJSONPrettyString

Convert a map object to a json formatted string.

BaseApi.asJSONPrettyString(Object obj)

Parameters

obj:   the object (can be a hashmap)

Sample Code

Map<String, Object> product = new HashMap<>();
product.put("productId", "11");
String strJson = BaseApi.asJSONPrettyString(product);

Returns

the formatted string​

asJSONString

Convert map object to a json string​ without formatting.

BaseApi.asJSONString(Object obj)

Parameters

obj:  object

Sample Code

Returns

fromJSONString

Convert a json string​ to a map object.

Parameters

Sample Code

Returns

fromJSONStringAsArray

Convert a json string​ as a linked hashmap. The map can be interpreted later on.

Parameters

Sample Code

Returns

readJSON

Read the JSON from a file name​ located in a specific directory. It is converted into an map object.

Parameters

Sample Code

Returns

writeJSON

Write a map object into a file​ located on a specific directory.

Parameters

Sample Code

Returns

writePrettyJSON

Write a map object into a file​ located on a specific directory. The JSON information is a formatted inside the file.

Parameters

Sample Code

Returns

successResult

Build and return a successful result map object.​

Parameters

Sample Code

Returns

errorResult

Build and return an error result map object.​

Parameters

Sample Code

Returns

extractMessage

Extract the message from the result object​. The result object has a detailed message in it therefore it will be returned.

Parameters

Returns

isResult

Checking whether the object is a result object​.

Parameters

Sample Code

Returns

isResultOrNull

Checking if result object is a valid one or a just a NuLL

Parameters

Sample Code

Returns

UUID

Generate a UUID sequence.

Parameters

Sample Code

Returns

uidToClassName

Extract class name​ from an input string.

Parameters

Returns

uidToId

Extract an long id number from a string UID.

Parameters

Returns

uidToIdStr

Retrieves​ the ID as a string from uid.

Parameters

Returns

waitForMillis

Wait for certain MS​ given as a long number. It is a blocking function call.

Parameters

Sample Code

Returns

remoteCall

// Basic Description //

Parameters

Sample Code

Returns

remoteCallAsResult

// Description //

Parameters

Sample Code

Returns

remoteCallAsMap

// Description //

Parameters

Sample Code

Returns

remoteCallAsString

// Description //

Parameters

Sample Code

Returns

remoteCallAsList

// Description //

Parameters

Returns

remoteCallAsListOfMaps

// Description //

Parameters

Returns

Last updated

Was this helpful?