Package com.gophers.structures.factory
Class AbstractGradeFactory
java.lang.Object
com.gophers.structures.factory.AbstractGradeFactory
- Direct Known Subclasses:
GradeFactory
Abstract factory class for creating
Grade objects.
Subclasses must implement the createItem(Result, int) method.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract GradecreateItem(org.junit.runner.Result result, int index) Creates a singleGradeobject based on the given test result and index.createItems(List<org.junit.runner.Result> results) Creates a list ofGradeobjects based on the given test results.
-
Constructor Details
-
AbstractGradeFactory
public AbstractGradeFactory()
-
-
Method Details
-
createItems
Creates a list ofGradeobjects based on the given test results.- Specified by:
createItemsin interfaceFactory<Grade>- Parameters:
results- A list of JUnitResultobjects containing the test results.- Returns:
- A list of
Gradeobjects created for each test result.
-
createItem
Creates a singleGradeobject based on the given test result and index. This method must be implemented by subclasses to specify the type ofGradeto create.- Specified by:
createItemin interfaceFactory<Grade>- Parameters:
result- The JUnitResultobject containing the test result details.index- The index to determine which grade object to create.- Returns:
- A
Gradeobject.
-