Page MenuHomeDevCentral

Allow to get first item of a collection
ClosedPublic

Authored by dereckson on Jun 14 2023, 21:08.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 7, 05:05
Unknown Object (File)
Fri, Jun 6, 01:12
Unknown Object (File)
Sun, Jun 1, 20:44
Unknown Object (File)
Fri, May 30, 01:09
Unknown Object (File)
Wed, May 28, 22:02
Unknown Object (File)
Wed, May 28, 14:11
Unknown Object (File)
Mon, May 26, 00:29
Unknown Object (File)
Fri, May 23, 13:57
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