Page MenuHomeDevCentral

Allow to get first item of a collection
ClosedPublic

Authored by dereckson on Jun 14 2023, 21:08.
Tags
None
Referenced Files
F18462369: D3197.id8156.diff
Fri, Dec 19, 11:59
Unknown Object (File)
Fri, Dec 19, 08:46
Unknown Object (File)
Tue, Dec 16, 22:26
Unknown Object (File)
Tue, Dec 16, 19:52
Unknown Object (File)
Mon, Dec 15, 10:17
Unknown Object (File)
Mon, Dec 15, 04:39
Unknown Object (File)
Tue, Dec 9, 22:09
Unknown Object (File)
Mon, Dec 8, 16:25
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