Package com.biglybt.util
Class MapUtils
java.lang.Object
com.biglybt.util.MapUtils
Various Map parsing utils.
ImportExportUtils has been merged into this class (conflicting logic in
methods have been kept separate as importXxx and exportXxx)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
exportBooleanAsLong
(Map map, String key, boolean value) static void
exportFloatAsString
(Map map, String key, float value) static void
static void
exportIntArrayAsByteArray
(Map map, String key, int[] values) static void
exportJSONStringArray
(Map map, String key, String[] data) static void
exportJSONURL
(Map map, String key, String value) static void
exportLong
(Map map, String key, long value) static void
exportStringArray
(Map map, String key, String[] data) static boolean
getMapBoolean
(Map map, String key, boolean def) static byte[]
getMapByteArray
(Map map, String key, byte[] def) static int
static List
getMapList
(Map map, String key, List def) static long
getMapLong
(Map map, String key, long def) static Map
static Object
getMapObject
(Map map, String key, Object def, Class cla) static String
getMapString
(Map map, String key, String def) Retrieves a string value from the map, parsing byte arrays if needed.static String[]
getMapStringArray
(Map map, String key, String[] def) static String
static float
importFloatFromString
(Map map, String key, float def) static int
static int[]
importIntArray
(Map map, String key) static long
importLong
(Map map, String key, long def) Retrieve a long from a map, parsing string values if neededstatic String
static String[]
importStringArray
(Map map, String key) static String
static void
setMapBoolean
(Map map, String key, boolean val) static void
static void
setMapString
(Map map, String key, String val) Puts a String value into a map as a UTF-8 byte array.static <K> K[]
-
Constructor Details
-
MapUtils
public MapUtils()
-
-
Method Details
-
setMapInt
-
getMapInt
-
getMapLong
-
getMapString
Retrieves a string value from the map, parsing byte arrays if needed. If the map is invalid, the key does not exist, or if the value is null, def is returned. -
getMapStringArray
-
getString
-
setMapString
Puts a String value into a map as a UTF-8 byte array. If value is null, removed key from map -
getMapByteArray
-
getMapObject
-
setMapBoolean
-
getMapBoolean
-
getMapList
-
getMapMap
-
importLong
Retrieve a long from a map, parsing string values if needed -
exportLong
-
exportInt
-
importInt
-
exportFloatAsString
-
importFloatFromString
-
exportBooleanAsLong
-
importURL
-
exportJSONURL
-
importStringArray
-
exportStringArray
-
exportJSONStringArray
-
exportIntArrayAsByteArray
-
importIntArray
-
importString
-
sortCount
-