Page MenuHomeDevCentral

Allow to get first item of a collection
ClosedPublic

Authored by dereckson on Jun 14 2023, 21:08.
Tags
None
Referenced Files
F3301636: D3197.diff
Tue, Jul 2, 20:03
Unknown Object (File)
Fri, Jun 28, 12:45
Unknown Object (File)
Sun, Jun 23, 22:25
Unknown Object (File)
Sat, Jun 22, 03:56
Unknown Object (File)
Fri, Jun 21, 17:18
Unknown Object (File)
Thu, Jun 20, 18:14
Unknown Object (File)
Sun, Jun 16, 22:49
Unknown Object (File)
Sun, Jun 16, 22:48
Subscribers
None

Details

Summary

This changes add to BaseCollection classes the following methods:

  • first() will return the first item if it exists
  • firstOr() will return the first item if it exists, or a default value if not.

Both are implemented by the WithCollection trait.

Test Plan

Tested in Zed

Diff Detail

Repository
rKERUALD Keruald libraries development repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable