Package com.axelor.common
Class ObjectUtils
java.lang.Object
com.axelor.common.ObjectUtils
This class defines from static helper methods to deal with objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Check whether the given value is an array.static boolean
Check whether the given value is empty.static boolean
isMutable
(Collection<?> collection) Check whether the given collection is mutable.static boolean
Check whether the given map is mutable.static boolean
Check whether the given value is not empty.
-
Constructor Details
-
ObjectUtils
public ObjectUtils()
-
-
Method Details
-
isArray
Check whether the given value is an array.- Parameters:
value
- the value to check- Returns:
- true if value is array false otherwise
-
isEmpty
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
Check whether the given value is not empty.- Parameters:
value
- the object value to check- Returns:
- true if not empty false otherwise
- See Also:
-
isMutable
Check whether the given map is mutable.- Parameters:
map
- the map to check- Returns:
- true if mutable false otherwise
-
isMutable
Check whether the given collection is mutable.- Parameters:
collection
- the collection to check- Returns:
- true if mutable false otherwise
-