Package com.xxl.tool.core
Class MapTool
java.lang.Object
com.xxl.tool.core.MapTool
Map Tool
- Author:
- xuxueli 2024-01-01
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <K> BooleangetBoolean(Map<? super K, ?> map, K key) get Boolean valuestatic <K> Byteget Byte valuestatic <K> Doubleget Double valuestatic <K> Floatget Float valuestatic <K> IntegergetInteger(Map<? super K, ?> map, K key) get Integer valuestatic <K> Longget Long valuestatic <K> Numberget Number valuestatic <K> Shortget Short valuestatic <K> Stringget string valuestatic booleancheck if is empty.static booleanisNotEmpty(Map<?, ?> map) check if is not empty.static <K,V> HashMap<K, V> newMap()build new HashMapstatic <K,V> HashMap<K, V> newMap(K k1, V v1) build new HashMap (multi)static <K,V> HashMap<K, V> newMap(K k1, V v1, K k2, V v2) build new HashMap (multi)static <K,V> HashMap<K, V> newMap(K k1, V v1, K k2, V v2, K k3, V v3) build new HashMap (multi)static <K,V> HashMap<K, V> newMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) build new HashMap (multi)static <K,V> HashMap<K, V> newMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) build new HashMap (multi)
-
Constructor Details
-
MapTool
public MapTool()
-
-
Method Details
-
isEmpty
check if is empty.- Parameters:
map- the map to check- Returns:
-
isNotEmpty
check if is not empty.- Parameters:
map- the map to check- Returns:
-
getString
get string value- Type Parameters:
K-- Parameters:
map-key-- Returns:
-
getBoolean
get Boolean value- Type Parameters:
K-- Parameters:
map-key-- Returns:
-
getNumber
get Number value- Type Parameters:
K-- Parameters:
map-key-- Returns:
-
getByte
get Byte value- Type Parameters:
K-- Parameters:
map-key-- Returns:
-
getShort
get Short value- Type Parameters:
K-- Parameters:
map-key-- Returns:
-
getInteger
get Integer value- Type Parameters:
K-- Parameters:
map-key-- Returns:
-
getLong
get Long value- Type Parameters:
K-- Parameters:
map-key-- Returns:
-
getFloat
get Float value- Type Parameters:
K-- Parameters:
map-key-- Returns:
-
getDouble
get Double value- Type Parameters:
K-- Parameters:
map-key-- Returns:
-
newMap
build new HashMap- Type Parameters:
K-V-- Returns:
-
newMap
build new HashMap (multi)- Type Parameters:
K-V-- Parameters:
k1-v1-- Returns:
-
newMap
build new HashMap (multi) -
newMap
build new HashMap (multi) -
newMap
build new HashMap (multi) -
newMap
public static <K,V> HashMap<K,V> newMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) build new HashMap (multi)
-