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 voidexportBooleanAsLong(Map map, String key, boolean value) static voidexportFloatAsString(Map map, String key, float value) static voidstatic voidexportIntArrayAsByteArray(Map map, String key, int[] values) static voidexportJSONStringArray(Map map, String key, String[] data) static voidexportJSONURL(Map map, String key, String value) static voidexportLong(Map map, String key, long value) static voidexportStringArray(Map map, String key, String[] data) static booleangetMapBoolean(Map map, String key, boolean def) static byte[]getMapByteArray(Map map, String key, byte[] def) static intstatic ListgetMapList(Map map, String key, List def) static longgetMapLong(Map map, String key, long def) static Mapstatic ObjectgetMapObject(Map map, String key, Object def, Class cla) static StringgetMapString(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 Stringstatic floatimportFloatFromString(Map map, String key, float def) static intstatic int[]importIntArray(Map map, String key) static longimportLong(Map map, String key, long def) Retrieve a long from a map, parsing string values if neededstatic Stringstatic String[]importStringArray(Map map, String key) static Stringstatic voidsetMapBoolean(Map map, String key, boolean val) static voidstatic voidsetMapString(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
-