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 TypeMethodDescriptionvoid
clear()
boolean
boolean
entrySet()
void
Put an error message in the result with an error code.void
Put an error message in the result with an error code.void
Put an error message in the result.boolean
isEmpty()
keySet()
Creates a new sub-map associated with a given key, stores it in the current map, and returns the newly created sub-map.void
Normalize the map so that it will contain only valid JSON values.void
normalize
(BiFunction<String, ContentProducer, String> contentToString) void
int
size()
toJSON()
Converts the current JSONMap instance into a JSON object representation.values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
-
size
-
isEmpty
-
containsKey
- Specified by:
containsKey
in interfaceMap<String,
Object>
-
containsValue
- Specified by:
containsValue
in 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
-