Package com.spertus.jacquard.common
Class Autograder.Builder
java.lang.Object
com.spertus.jacquard.common.Autograder.Builder
- Enclosing class:
- Autograder
A singleton class for building the Autograder.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The default Java language level.static final long
The default timeout for aGrader
, in milliseconds.static final Visibility
The default visibility of test results. -
Method Summary
Modifier and TypeMethodDescriptionvoid
build()
Builds the Autograder using information from this builder.static Autograder.Builder
Gets the singleton instance of Builder.javaLevel
(int javaLevel) Sets the Java language level.timeout
(long timeout) Sets the timeout forGrader
execution (or 0 for no timeout).visibility
(Visibility visibility) Sets the visibility ofGrader
results.
-
Field Details
-
DEFAULT_TIMEOUT_MS
public static final long DEFAULT_TIMEOUT_MSThe default timeout for aGrader
, in milliseconds.- See Also:
-
DEFAULT_JAVA_LEVEL
public static final int DEFAULT_JAVA_LEVELThe default Java language level.- See Also:
-
DEFAULT_VISIBILITY
The default visibility of test results.
-
-
Method Details
-
getInstance
Gets the singleton instance of Builder.- Returns:
- the instance
-
timeout
Sets the timeout forGrader
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
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
Sets the visibility ofGrader
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 (unlessVisibleForTesting
methods are used).- Throws:
ClientException
- if this builder has already been built
-