DHUCollectionsExtensionsNS<E> extension
Utility extensions for nullable iterables.
- on
-
- Iterable<
E> ?
- Iterable<
Properties
- isEmptyOrNull → bool
-
Available on Iterable<
ReturnsE> ?, provided by the DHUCollectionsExtensionsNS extensiontrueif this nullable iterable is either null or empty.no setter - isNotEmptyOrNull → bool
-
Available on Iterable<
ReturnsE> ?, provided by the DHUCollectionsExtensionsNS extensionfalseif this nullable iterable is either null or empty.no setter
Methods
-
firstOrDefault(
E defaultValue) → E -
Available on Iterable<
Returns the first element orE> ?, provided by the DHUCollectionsExtensionsNS extensiondefaultValuewhen null or empty. -
isEqual(
Iterable< E> ? other) → bool -
Available on Iterable<
Compares two lists for element-by-element equality.E> ?, provided by the DHUCollectionsExtensionsNS extension -
isPrimitive(
) → bool -
Available on Iterable<
ReturnsE> ?, provided by the DHUCollectionsExtensionsNS extensiontruewhen every element is a primitive value. -
lastOrDefault(
E defaultValue) → E? -
Available on Iterable<
Returns the last element orE> ?, provided by the DHUCollectionsExtensionsNS extensiondefaultValuewhen null or empty. -
of(
int index) → E? -
Available on Iterable<
Returns the element atE> ?, provided by the DHUCollectionsExtensionsNS extensionindexornullif out of bounds or null. -
totalBy(
num? valueSelector(E)) → num -
Available on Iterable<
Returns the sum of values calculated byE> ?, provided by the DHUCollectionsExtensionsNS extensionvalueSelectorfor each element. -
tryGetRandom(
[int? seed]) → E? -
Available on Iterable<
Retrieves a random element or null if the iterable is null.E> ?, provided by the DHUCollectionsExtensionsNS extension