Add isEmpty method to JsonArray class (#1640)
The method will return true if the array is empty and false if it's not
This commit is contained in:
parent
360cd3e2da
commit
fa947212e0
@ -171,6 +171,15 @@ public final class JsonArray extends JsonElement implements Iterable<JsonElement
|
|||||||
public int size() {
|
public int size() {
|
||||||
return elements.size();
|
return elements.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the array is empty
|
||||||
|
*
|
||||||
|
* @return true if the array is empty
|
||||||
|
*/
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return elements.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an iterator to navigate the elements of the array. Since the array is an ordered list,
|
* Returns an iterator to navigate the elements of the array. Since the array is an ordered list,
|
||||||
|
Loading…
Reference in New Issue
Block a user