sealedTopNode property

ClassDefinition? get sealedTopNode

Returns the top node of the sealed hierarchy. If the class is the top node it returns itself. If the class is not part of a sealed hierarchy, null is returned.

Implementation

ClassDefinition? get sealedTopNode {
  var parent = parentClass;
  if (parent != null) {
    var parentsSealedTopNode = parent.sealedTopNode;
    if (parentsSealedTopNode != null) return parentsSealedTopNode;
  }

  if (isSealed) return this;

  return null;
}