map<RK, RV> method
IMapOfSets<RK, RV>
map<RK, RV>(
- MapEntry<
RK, ISet< mapper(RV> >- K key,
- ISet<
V> set
- ConfigMapOfSets? config,
Returns a new map where all entries of this map are transformed by the given mapper
function. You may provide a config
, otherwise it will be the same as the original map.
Implementation
@useCopy
IMapOfSets<RK, RV> map<RK, RV>(
MapEntry<RK, ISet<RV>> Function(K key, ISet<V> set) mapper, {
ConfigMapOfSets? config,
}) {
bool Function(RK key, ISet<RV> set)? ifRemove;
if ((config ?? this.config).removeEmptySets) ifRemove = (RK key, ISet<RV> set) => set.isEmpty;
return IMapOfSets<RK, RV>.from(
_mapOfSets.map(mapper, ifRemove: ifRemove),
config: config ?? this.config,
);
}