Class AbstractGradeFactory

java.lang.Object
com.gophers.structures.factory.AbstractGradeFactory
All Implemented Interfaces:
Factory<Grade>
Direct Known Subclasses:
GradeFactory

public abstract class AbstractGradeFactory extends Object implements Factory<Grade>
Abstract factory class for creating Grade objects. Subclasses must implement the createItem(Result, int) method.
  • Constructor Details

    • AbstractGradeFactory

      public AbstractGradeFactory()
  • Method Details

    • createItems

      public List<Grade> createItems(List<org.junit.runner.Result> results)
      Creates a list of Grade objects based on the given test results.
      Specified by:
      createItems in interface Factory<Grade>
      Parameters:
      results - A list of JUnit Result objects containing the test results.
      Returns:
      A list of Grade objects created for each test result.
    • createItem

      public abstract Grade createItem(org.junit.runner.Result result, int index)
      Creates a single Grade object based on the given test result and index. This method must be implemented by subclasses to specify the type of Grade to create.
      Specified by:
      createItem in interface Factory<Grade>
      Parameters:
      result - The JUnit Result object containing the test result details.
      index - The index to determine which grade object to create.
      Returns:
      A Grade object.