Package com.axelor.common
Class ObjectUtils
- java.lang.Object
-
- com.axelor.common.ObjectUtils
-
public final class ObjectUtils extends Object
This class defines from static helper methods to deal with objects.
-
-
Constructor Summary
Constructors Constructor Description ObjectUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isArray(Object value)
Check whether the given value is an array.static boolean
isEmpty(Object value)
Check whether the given value is empty.static boolean
notEmpty(Object value)
Check whether the given value is not empty.
-
-
-
Method Detail
-
isArray
public static boolean isArray(Object value)
Check whether the given value is an array.- Parameters:
value
- the value to check- Returns:
- true if value is array false otherwise
-
isEmpty
public static boolean isEmpty(Object value)
Check whether the given value is empty.An object value is empty if:
- value is null
- value is
Optional
andOptional.empty()
- value is
Array
with length 0 - value is
CharSequence
with length 0 - value is
Collection
orMap
with size 0
- Parameters:
value
- the object value to check- Returns:
- true if empty false otherwise
-
notEmpty
public static boolean notEmpty(Object value)
Check whether the given value is not empty.- Parameters:
value
- the object value to check- Returns:
- true if not empty false otherwise
- See Also:
isEmpty(Object)
-
-