Package com.tangosol.net.management
Interface MapJsonBodyHandler
- All Superinterfaces:
com.tangosol.internal.http.BaseHttpHandler.BodyWriter<Map<String,,Object>> Comparable<MapJsonBodyHandler>
public interface MapJsonBodyHandler
extends com.tangosol.internal.http.BaseHttpHandler.BodyWriter<Map<String,Object>>, Comparable<MapJsonBodyHandler>
A class that can serialize and deserialize
Maps
to and from json.- Since:
- 22.06
- Author:
- Jonathan Knight 2022.01.25
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault intstatic MapJsonBodyHandlerLoad aMapJsonBodyHandlerusing the JVM'sServiceLoadermechanism.default intReturn the priority of thisMapJsonBodyHandler.default booleanReturntrueif thisMapJsonBodyHandleris enabled.readMap(InputStream in) Read a jsonInputStreamand deserialize into aMap.voidwrite(Map<String, Object> body, OutputStream out) Write the specifiedObjectto theOutputStream.
-
Field Details
-
DEFAULT_PRIORITY
static final int DEFAULT_PRIORITYThe default priority.- See Also:
-
-
Method Details
-
write
Description copied from interface:com.tangosol.internal.http.BaseHttpHandler.BodyWriterWrite the specifiedObjectto theOutputStream.- Specified by:
writein interfacecom.tangosol.internal.http.BaseHttpHandler.BodyWriter<Map<String,Object>> - Parameters:
body- the object to writeout- theOutputStreamto write to
-
readMap
Read a jsonInputStreamand deserialize into aMap.- Parameters:
in- theInputStreamcontaining json data- Returns:
- a
Mapof the deserialized json data
-
isEnabled
default boolean isEnabled()Returntrueif thisMapJsonBodyHandleris enabled.- Returns:
trueif thisMapJsonBodyHandleris enabled
-
getPriority
default int getPriority()Return the priority of thisMapJsonBodyHandler.The priority is used to determine which instance to use if multiple implementations are loaded by the service loader. The implementation that returns the lowest priority will be used.
The default implementation of this method returns
DEFAULT_PRIORITY.- Returns:
- the priority of this
MapJsonBodyHandler
-
compareTo
- Specified by:
compareToin interfaceComparable<MapJsonBodyHandler>
-
ensureMapJsonBodyHandler
Load aMapJsonBodyHandlerusing the JVM'sServiceLoadermechanism.- Returns:
- a
MapJsonBodyHandlerloaded via theServiceLoader - Throws:
IllegalStateException- if noMapJsonBodyHandlercan be loaded
-