Package com.storedobject.core
Class JSONMap
java.lang.Object
com.storedobject.core.JSONMap
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleanbooleanentrySet()voidPut an error message in the result with an error code.voidPut an error message in the result with an error code.voidPut an error message in the result.booleanisEmpty()keySet()Creates a new sub-map associated with a given key, stores it in the current map, and returns the newly created sub-map.voidNormalize the map so that it will contain only valid JSON values.voidnormalize(BiFunction<String, ContentProducer, String> contentToString) voidvoidsetRawMode(boolean rawMode) intsize()toJSON()Converts the current JSONMap instance into a JSON object representation.toString()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
JSONMap
public JSONMap() -
JSONMap
public JSONMap(boolean withErrorCode)
-
-
Method Details
-
setRawMode
public void setRawMode(boolean rawMode) -
size
-
isEmpty
-
containsKey
- Specified by:
containsKeyin interfaceMap<String,Object>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,Object>
-
get
-
put
-
map
-
toJSON
Converts the current JSONMap instance into a JSON object representation.- Returns:
- A JSON object constructed from the current JSONMap instance.
-
remove
-
putAll
-
clear
-
keySet
-
values
-
entrySet
-
error
Put an error message in the result.- Parameters:
error- Error message to be added.
-
error
Put an error message in the result with an error code.- Parameters:
errorCode- Error code.error- Error message to be added.
-
error
Put an error message in the result with an error code.- Parameters:
error- Error (could be null).
-
normalize
public void normalize()Normalize the map so that it will contain only valid JSON values. -
normalize
- Parameters:
contentToString- Function to convert ContentProducer to String. Normalize the map so that it will contain only valid JSON values.
-
array
-
toString
-