Page MenuHomeDevCentral

Allow to get first item of a collection
ClosedPublic

Authored by dereckson on Jun 14 2023, 21:08.
Tags
None
Referenced Files
F3935766: D3197.id8157.diff
Mon, Dec 23, 09:26
Unknown Object (File)
Sat, Dec 21, 20:42
Unknown Object (File)
Sat, Dec 21, 20:42
Unknown Object (File)
Sat, Dec 21, 20:42
Unknown Object (File)
Fri, Dec 20, 04:00
Unknown Object (File)
Wed, Dec 18, 09:10
Unknown Object (File)
Thu, Dec 5, 17:53
Unknown Object (File)
Thu, Dec 5, 17:52
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 Passed
Unit
Test Failures
Branch
collection-first
Build Status
Buildable 5032
Build 5313: arc lint + arc unit