Package com.yahoo.fs4
Class MapEncoder
- java.lang.Object
-
- com.yahoo.fs4.MapEncoder
-
public class MapEncoder extends Object
A static utility for encoding values to the binary map representation used in fs4 packets.- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description MapEncoder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.
-
-
-
Method Detail
-
encodeSingleValue
public static int encodeSingleValue(String mapName, String key, Object value, ByteBuffer buffer)
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
public static int encodeMap(String mapName, Map<String,?> map, ByteBuffer buffer)
Encodes a map as binary. Does nothing if the value is null. Returns the number of maps encoded - 0 or 1
-
encodeMultiMap
public static <T> int encodeMultiMap(String mapName, Map<String,List<T>> map, ByteBuffer buffer)
Encodes a multi-map as binary. Does nothing if the value is null. Returns the number of maps encoded - 0 or 1
-
-