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)
Tue, Nov 19, 02:09
Unknown Object (File)
Tue, Nov 12, 04:33
Unknown Object (File)
Sun, Nov 10, 13:05
Unknown Object (File)
Fri, Nov 8, 18:20
Unknown Object (File)
Fri, Nov 8, 12:04
Unknown Object (File)
Fri, Nov 8, 11:59
Unknown Object (File)
Fri, Nov 8, 10:01
Unknown Object (File)
Fri, Nov 8, 08:17
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