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, 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
Unknown Object (File)
Thu, Dec 5, 10:22
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
Tests Passed
Branch
collection-first
Build Status
Buildable 5033
Build 5314: arc lint + arc unit