Class GradeFactory

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

public class GradeFactory extends AbstractGradeFactory
A factory class to create specific types of Grade objects based on the given index.
  • Constructor Details

    • GradeFactory

      public GradeFactory()
  • Method Details

    • createItem

      public Grade createItem(org.junit.runner.Result result, int index)
      Creates a specific Grade object based on the given index.
      Specified by:
      createItem in interface Factory<Grade>
      Specified by:
      createItem in class AbstractGradeFactory
      Parameters:
      result - The JUnit Result object containing the test result details.
      index - The index to determine which grade object to create.
      Returns:
      A new instance of a Grade subclass.
      Throws:
      IllegalArgumentException - if the index does not match any defined grade type.