-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Milestone
Description
An often-used idiom for checking for empty Arrays and Object for JsonNode
is:
if (arrayNode.size() == 0) { // is empty
}
and due to common use, would make sense to allow use via alias
if (arrayNode.isEmpty()) { ...
}
Semantically it makes sense for containers (Arrays, Objects). For scalars, we could either always return true
, or have per-type logic.
I think that former makes more sense at this point even though there may be some confusing in contrast to JsonSerializer.isEmpty()
(which does implement much more complex logic).
Metadata
Metadata
Assignees
Labels
No labels