File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,15 @@ Data sequences change log
33
44## ?.?.? / ????-??-??
55
6+ * Introduce dedicated ` util.data.NoSuchElement ` exception. It's thrown
7+ from ` Optional::get() ` if no element is present instead of the generic
8+ ` util.NoSuchElementException ` . For BC reasons, it extends the latter.
9+ (@thekid )
10+ * Implemented PR #54 : Implement ` Sequence::single() ` - which is similar
11+ to ` first() ` but raises an exception if there are more than 1 element
12+ in the sequence.
13+ (@thekid )
14+
615## 10.0.0 / 2021-10-21
716
817* Implemented xp-framework/rfc #341 , dropping compatibility with XP 9
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ The following operations return a single value by consuming all of the sequence:
109109* ** toArray** - will return a PHP array with zero-based keys
110110* ** toMap** - will return a PHP associative array
111111* ** first** - will return the first element as an ` util.data.Optional ` instance. A value will be present if the sequence was not empty.
112+ * ** single** - like ` first() ` , but raises an exception if more than one element is contained in the sequence.
112113* ** count** - will return the number of elements in the sequence
113114* ** min** - returns the smalles element. Compares numbers by default but may be given a comparator function or a ` util.Comparator ` instance.
114115* ** max** - same as ` min() ` , but returns the largest element instead.
You can’t perform that action at this time.
0 commit comments