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 deserializeMapsto and from json.- Since:
- 22.06
- Author:
- Jonathan Knight 2022.01.25
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PRIORITYThe default priority.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intcompareTo(MapJsonBodyHandler o)static MapJsonBodyHandlerensureMapJsonBodyHandler()Load aMapJsonBodyHandlerusing the JVM'sServiceLoadermechanism.default intgetPriority()Return the priority of thisMapJsonBodyHandler.default booleanisEnabled()Returntrueif thisMapJsonBodyHandleris enabled.Map<String,Object>readMap(InputStream in)Read a jsonInputStreamand deserialize into aMap.voidwrite(Map<String,Object> body, OutputStream out)Write the specifiedObjectto theOutputStream.
-
-
-
Field Detail
-
DEFAULT_PRIORITY
static final int DEFAULT_PRIORITY
The default priority.- See Also:
- Constant Field Values
-
-
Method Detail
-
write
void write(Map<String,Object> body, OutputStream out)
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
Map<String,Object> readMap(InputStream in)
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
default int compareTo(MapJsonBodyHandler o)
- Specified by:
compareToin interfaceComparable<MapJsonBodyHandler>
-
ensureMapJsonBodyHandler
static MapJsonBodyHandler ensureMapJsonBodyHandler()
Load aMapJsonBodyHandlerusing the JVM'sServiceLoadermechanism.- Returns:
- a
MapJsonBodyHandlerloaded via theServiceLoader - Throws:
IllegalStateException- if noMapJsonBodyHandlercan be loaded
-
-