Constructor and Description |
---|
NullUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isBlank(Object object)
Return true if object is a non null CharSequence that is pure whitespace
|
static boolean |
isNone(String s)
Return true if:
|
static boolean |
isNull(String s)
Return true if:
|
static boolean |
isNullOrBlank(Object object)
Return true if object is null OR a non null CharSequence that is pure whitespace
|
static boolean |
isNullOrNone(String s)
Return true iff:
|
static com.google.common.base.Optional<String> |
toAbsent(String s)
Returns
Optional.absent() if s is null, the empty string, pure whitespace, NONE, or NULL |
static String |
toNone(com.google.common.base.Optional<String> optional)
Returns
NONE if optional is not present OR if it contains the empty string, pure whitespace, NONE, or NULL |
static String |
trimToNone(String s)
Returns
NONE if s is null, the empty string, pure whitespace, NONE, or NULL |
static String |
trimToNull(String s)
Returns
null if s is null, the empty string, pure whitespace, NONE, or NULL |
public static final String NONE
public static final String NULL
public NullUtils()
public static boolean isBlank(Object object)
public static boolean isNullOrBlank(Object object)
public static final boolean isNull(String s)
s == null StringUtils.equalsIgnoreCase("null", s) == true
public static final boolean isNone(String s)
StringUtils.equalsIgnoreCase("none", s) == true
public static final boolean isNullOrNone(String s)
s == null StringUtils.equalsIgnoreCase("null", s) == true StringUtils.equalsIgnoreCase("none", s) == true
public static final com.google.common.base.Optional<String> toAbsent(String s)
Optional.absent()
if s is null, the empty string, pure whitespace, NONE, or NULLpublic static final String toNone(com.google.common.base.Optional<String> optional)
NONE
if optional is not present OR if it contains the empty string, pure whitespace, NONE, or NULLpublic static final String trimToNull(String s)
null
if s is null, the empty string, pure whitespace, NONE, or NULLpublic static final String trimToNone(String s)
NONE
if s is null, the empty string, pure whitespace, NONE, or NULLCopyright © 2010–2014 The Kuali Foundation. All rights reserved.