compareAttributes method

int compareAttributes(
  1. E entity
)

Compare attributes one by one until a difference is found. Return negative if this < that; zero if same; positive if this > that.

Implementation

int compareAttributes(E entity) {
  var compare = 0;
  for (Attribute a in concept.attributes.whereType<Attribute>()) {
    var value1 = _attributeMap[a.code];
    var value2 = entity.getAttribute(a.code);

    compare = a.type?.compare(value1, value2) ?? 0;
    if (compare != 0) {
      break;
    }
  }
  return compare;
}