Package com.yahoo.fs4
Class MapEncoder
java.lang.Object
com.yahoo.fs4.MapEncoder
A static utility for encoding values to the binary map representation used in fs4 packets.
- Author:
- bratseth
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
encodeMap
(String mapName, Map<String, ?> map, ByteBuffer buffer) Encodes a map as binary.static <T> int
encodeMultiMap
(String mapName, Map<String, List<T>> map, ByteBuffer buffer) Encodes a multi-map as binary.static int
encodeSingleValue
(String mapName, String key, Object value, ByteBuffer buffer) Encodes a single value as a complete binary map.
-
Constructor Details
-
MapEncoder
public MapEncoder()
-
-
Method Details
-
encodeSingleValue
Encodes a single value as a complete binary map. Does nothing if the value is null. Returns the number of maps encoded - 0 or 1 -
encodeMap
Encodes a map as binary. Does nothing if the value is null. Returns the number of maps encoded - 0 or 1 -
encodeMultiMap
Encodes a multi-map as binary. Does nothing if the value is null. Returns the number of maps encoded - 0 or 1
-