Page MenuHomeDevCentral

Allow to get first item of a collection
ClosedPublic

Authored by dereckson on Jun 14 2023, 21:08.
Tags
None
Referenced Files
F24613202: D3197.id8157.diff
Sun, Mar 1, 17:20
Unknown Object (File)
Fri, Feb 27, 12:07
Unknown Object (File)
Thu, Feb 26, 17:43
Unknown Object (File)
Thu, Feb 26, 06:18
Unknown Object (File)
Mon, Feb 23, 10:19
Unknown Object (File)
Mon, Feb 23, 06:29
Unknown Object (File)
Sun, Feb 22, 18:19
Unknown Object (File)
Fri, Feb 20, 10:28
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