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)
Sun, Jan 19, 08:18
Unknown Object (File)
Sun, Jan 19, 08:03
Unknown Object (File)
Sun, Jan 12, 01:04
Unknown Object (File)
Sun, Jan 12, 00:46
Unknown Object (File)
Sat, Jan 11, 18:47
Unknown Object (File)
Dec 27 2024, 21:03
Unknown Object (File)
Dec 27 2024, 16:20
Unknown Object (File)
Dec 26 2024, 02:41
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