ParameterSupplier (JUnit API)
Date: 2018-08-04

org.junit.experimental.theories

## Class ParameterSupplier

- java.lang.Object
- - org.junit.experimental.theories.ParameterSupplier

- Direct Known Subclasses:
    TestedOnSupplier

      public abstract class ParameterSupplier
      extends java.lang.Object

  Abstract parent class for suppliers of input data points for theories. Extend this class to customize how `Theories` runner finds accepted data points. Then use your class together with @ParametersSuppliedBy on input parameters for theories.

  For example, here is a supplier for values between two integers, and an annotation that references it:

           @Retention(RetentionPolicy.RUNTIME)
           @ParametersSuppliedBy(BetweenSupplier.class)
           public @interface Between {
               int first();

               int last();
           }

           public static class BetweenSupplier extends ParameterSupplier {
               @Override
               public List<PotentialAssignment> getValueSources(ParameterSignature sig) {
                   List<PotentialAssignment> list = new ArrayList<PotentialAssignment>();
                   Between annotation = (Between) sig.getSupplierAnnotation();

                   for (int i = annotation.first(); i <= annotation.last(); i++)
                       list.add(PotentialAssignment.forValue("ints", i));
                   return list;
               }
           }

  See Also:
    `ParametersSuppliedBy`, `Theories`, `FromDataPoints`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ParameterSupplier()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract java.util.List<PotentialAssignment>` | `getValueSources(ParameterSignature sig)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ParameterSupplier

          public ParameterSupplier()

  - ### Method Detail

    - #### getValueSources

          public abstract java.util.List<PotentialAssignment> getValueSources(ParameterSignature sig)
                                                                       throws java.lang.Throwable

      Throws:
        `java.lang.Throwable`