Class Autograder.Builder

java.lang.Object
com.spertus.jacquard.common.Autograder.Builder
Enclosing class:
Autograder

public static class Autograder.Builder extends Object
A singleton class for building the Autograder.
  • Field Details

    • DEFAULT_TIMEOUT_MS

      public static final long DEFAULT_TIMEOUT_MS
      The default timeout for a Grader, in milliseconds.
      See Also:
    • DEFAULT_JAVA_LEVEL

      public static final int DEFAULT_JAVA_LEVEL
      The default Java language level.
      See Also:
    • DEFAULT_VISIBILITY

      public static final Visibility DEFAULT_VISIBILITY
      The default visibility of test results.
  • Method Details

    • getInstance

      public static Autograder.Builder getInstance()
      Gets the singleton instance of Builder.
      Returns:
      the instance
    • timeout

      public Autograder.Builder timeout(long timeout)
      Sets the timeout for Grader execution (or 0 for no timeout). If this method is not called, DEFAULT_TIMEOUT_MS is used.
      Parameters:
      timeout - the timeout in milliseconds or 0 for no timeout
      Returns:
      the builder
      Throws:
      ClientException - if this builder has already been built
    • javaLevel

      public Autograder.Builder javaLevel(int javaLevel)
      Sets the Java language level. If this method is not called, DEFAULT_JAVA_LEVEL is used.
      Parameters:
      javaLevel - the Java language level
      Returns:
      the builder
      Throws:
      ClientException - if this builder has already been built
    • visibility

      public Autograder.Builder visibility(Visibility visibility)
      Sets the visibility of Grader results. If this method is no called, DEFAULT_VISIBILITY is used.
      Parameters:
      visibility - the visibility
      Returns:
      the builder
      Throws:
      ClientException - if this builder has already been built
    • build

      public void build()
      Builds the Autograder using information from this builder. This may be called only once per program execution (unless VisibleForTesting methods are used).
      Throws:
      ClientException - if this builder has already been built