public class ObjectUtils extends Object
| 构造器和说明 |
|---|
ObjectUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> List<T> |
nonNull(List<T> list)
If list is null, return new mutable empty list; else list it's self
|
static <K,V> Map<K,V> |
nonNull(Map<K,V> map)
If map is null, return new mutable empty map; else map it's self
|
static <T> Set<T> |
nonNull(Set<T> set)
If set is null, return new mutable empty set; else set it's self
|
static String |
nonNull(String value)
If value is null, return "", else return value
|
static <T> T |
nonNull(T value,
T defaultValue)
If value is null, return defaultValue; else return value
|
static boolean |
unbox(Boolean value)
Safe unbox, return false if value is null
|
static byte |
unbox(Byte value)
Safe unbox, return 0 if value is null
|
static char |
unbox(Character value)
Safe unbox, return '0' if value is null
|
static double |
unbox(Double value)
Safe unbox, return 0 if value is null
|
static float |
unbox(Float value)
Safe unbox, return 0 if value is null
|
static int |
unbox(Integer value)
Safe unbox, return 0 if value is null
|
static long |
unbox(Long value)
Safe unbox, return 0 if value is null
|
static short |
unbox(Short value)
Safe unbox, return 0 if value is null
|
public static <T> T nonNull(T value,
T defaultValue)
public static <T> List<T> nonNull(List<T> list)
public static <T> Set<T> nonNull(Set<T> set)
public static <K,V> Map<K,V> nonNull(Map<K,V> map)
public static boolean unbox(Boolean value)
public static char unbox(Character value)
public static byte unbox(Byte value)
public static short unbox(Short value)
public static int unbox(Integer value)
public static long unbox(Long value)
public static float unbox(Float value)
public static double unbox(Double value)
Copyright © 2015. All rights reserved.