Class NrwList

java.lang.Object
org.openpatch.scratch.internal.NrwList

public final class NrwList extends Object
Builds a List of the kind the NRW Zentralabitur hands out.

Those classes live in the default package of the student's project, where a library cannot name them. So the class is looked up by name when it is needed, through the class loader of the student's own classes, and filled through its append method. The caller hands the result back with a type the compiler infers from the assignment, which is how List<Gegner> gegner = find(Gegner.class) compiles in the NRW build.

  • Method Details

    • of

      public static <L> L of(Iterable<?> items, Class<?>... hints)
      Returns a new NRW List holding the given items, in order.
      Type Parameters:
      L - the student's List type, inferred at the call site
      Parameters:
      items - the items to append
      hints - classes of the student's project, whose class loader also loaded their List; the context class loader is tried after them
      Returns:
      the filled list