public class Obj extends Object
Constructor and Description |
---|
Obj() |
Modifier and Type | Method and Description |
---|---|
static boolean |
contains(Object map,
String... keys) |
static boolean |
equals(Object v1,
Object v2)
A null-safe equals check using v1.equals(v2) if they are both not null.
|
static Object |
get(Map<String,Object> map,
String... keys)
Used to make getting values from maps embedded in maps embedded in maps
easier TODO: roll out the loops for efficiency
|
static Map<String,Object> |
newMap()
Helper function for creating maps and tuning them as necessary.
|
static Map<String,Object> |
newMap(String key,
Object value)
Helper function for creating maps and tuning them as necessary.
|
static Object |
put(Object map,
String key1,
Object value) |
static Object |
put(Object map,
String key1,
String key2,
Object value) |
static Object |
put(Object map,
String key1,
String key2,
String key3,
Object value) |
static Object |
put(Object map,
String key1,
String key2,
String key3,
String key4,
Object value) |
static Object |
remove(Object map,
String k1,
String k2) |
public static Map<String,Object> newMap()
Map
instance.public static Map<String,Object> newMap(String key, Object value)
key
- A key to add to the map on creation.value
- A value to attach to the key in the new map.Map
instance.public static Object get(Map<String,Object> map, String... keys)
map
- The map to get a key fromkeys
- The list of keys to attempt to get from the map. The first key
found with a non-null value is returned, or if none are found,
the original map is returned.public static Object put(Object map, String key1, String key2, String key3, String key4, Object value)
public static boolean equals(Object v1, Object v2)
v1
- The source object for the equals check.v2
- The object to be checked for equality using the first objects
equals method.Copyright © 2018. All rights reserved.