Package tenapull.util
Class MakeMap
java.lang.Object
tenapull.util.MakeMap
public class MakeMap
extends java.lang.Object
Static utility for making a map from an array of Objects. Used as a substitute for
Map.of() since that throws exceptions if any of the arguments are null
-
Constructor Details
-
MakeMap
public MakeMap()
-
-
Method Details
-
of
public static java.util.LinkedHashMap of(java.lang.Object[] entries) throws java.lang.IllegalArgumentExceptionCreates a map from the passed array of Objects {key1, value1, key2, value2, etc...}- Parameters:
entries
- key-value pairs to construct the map with- Returns:
- the constructed map
- Throws:
java.lang.IllegalArgumentException
- if the entries array has an odd-numbered length
-