|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.common.util.nullify.NullUtils
public class NullUtils
Field Summary | |
---|---|
static String |
NONE
|
static String |
NULL
|
Constructor Summary | |
---|---|
NullUtils()
|
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String NONE
public static final String NULL
Constructor Detail |
---|
public NullUtils()
Method Detail |
---|
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 NULL
public 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 NULL
public static final String trimToNull(String s)
null
if s is null, the empty string, pure whitespace, NONE, or NULL
public static final String trimToNone(String s)
NONE
if s is null, the empty string, pure whitespace, NONE, or NULL
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |