classifyIterableElements method

IterableClassification classifyIterableElements(
  1. Iterable<Object?> itr
)

Implementation

IterableClassification classifyIterableElements(Iterable<Object?> itr) {
  var hasNull = false;
  var hasObj = false;
  var hasMap = false;
  var hasId = false;
  var hasOther = false;

  for (var e in itr) {
    if (e == null) {
      hasNull = true;
    } else if (e is O) {
      hasObj = true;
    } else if (e is Map) {
      hasMap = true;
    } else if (e.isEntityIDPrimitiveType) {
      hasId = true;
    } else {
      hasOther = true;
    }
  }

  return IterableClassification(
      hasNull: hasNull,
      hasObj: hasObj,
      hasMap: hasMap,
      hasId: hasId,
      hasOther: hasOther);
}