Files

14 lines
381 B
Java

// An ordinary (identity) record. No value classes anywhere in this file.
import java.util.List;
record Node(String label, List<Node> edges) {
static void nullCheck(Object arg, Object owner) {
if (arg == null) throw new IllegalArgumentException("null arg for " + owner);
}
public Node {
nullCheck(label, this);
nullCheck(edges, this);
}
}