Package io.mosip.kernel.core.util
Class EmptyCheckUtils
- java.lang.Object
-
- io.mosip.kernel.core.util.EmptyCheckUtils
-
public final class EmptyCheckUtils extends Object
This class is used to avoid NPE: NullPointerException easily.- Since:
- 1.0.0
- Author:
- Bal Vikash Sharma
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisNullEmpty(Object obj)This method used to check if givenobjis null.static booleanisNullEmpty(String str)This method is used to check if the givenstris null or an empty string.static booleanisNullEmpty(Collection<?> collection)This method is used to check givencollectionis null or is Empty.static booleanisNullEmpty(Map<?,?> map)This method is used to check givenmapis null or is Empty.
-
-
-
Method Detail
-
isNullEmpty
public static boolean isNullEmpty(Object obj)
This method used to check if givenobjis null.- Parameters:
obj- is of any java.lang.Object type.- Returns:
- true if
objis null.
-
isNullEmpty
public static boolean isNullEmpty(String str)
This method is used to check if the givenstris null or an empty string.- Parameters:
str- id of type java.lang.String- Returns:
- true if given
stris null or length of it is Zero after trim.
-
isNullEmpty
public static boolean isNullEmpty(Collection<?> collection)
This method is used to check givencollectionis null or is Empty.- Parameters:
collection- is of type java.util.Collection.- Returns:
- true if given
collectionis null or does not contains any element inside it.
-
isNullEmpty
public static boolean isNullEmpty(Map<?,?> map)
This method is used to check givenmapis null or is Empty.- Parameters:
map- is of type java.util.Map- Returns:
- true if given
mapis null or does not contains any key, values pairs inside it.
-
-