OCLOperators isEmpty
This page was created by Alexandra on 2017-08-13. Last edited by Martin on 2025-09-12.
isEmpty () : Boolean
Returns true if self is empty - otherwise, returns false.
Expression | Result |
---|---|
Sequence{2, 1}->isEmpty() | false |
Sequence{nil}->isEmpty | true |
<class>.EmptyList->isEmpty | true |
Warning!
Never use ->isEmpty on a value type. The value will be converted to a list (with the value as its only item) and that will always evaluate as False.
See also: OCLOperators notEmpty