Class ListsDSL.ListGeneratorBuilder<T>

  • Type Parameters:
    T - type to generate
    Enclosing class:
    ListsDSL

    public static class ListsDSL.ListGeneratorBuilder<T>
    extends Object
    ListGeneratorBuilder enables the creation of Sources for Lists of fixed and bounded size, where no Collector is specified. A ListGeneratorBuilder can be used to create a TypedListGeneratorBuilder, where the Collector is specified.
    • Field Detail

      • source

        protected final org.quicktheories.core.Gen<T> source
    • Method Detail

      • ofSize

        public org.quicktheories.core.Gen<List<T>> ofSize​(int size)
        Generates a List of objects, where the size of the List is fixed
        Parameters:
        size - size of lists to generate
        Returns:
        a Source of Lists of type T
      • ofSizeBetween

        public org.quicktheories.core.Gen<List<T>> ofSizeBetween​(int minimumSize,
                                                                 int maximumSize)
        Generates a List of objects, where the size of the List is bounded by minimumSize and maximumSize
        Parameters:
        minimumSize - - inclusive minimum size of List
        maximumSize - - inclusive maximum size of List
        Returns:
        a Source of Lists of type T
      • ofSizes

        public org.quicktheories.core.Gen<List<T>> ofSizes​(org.quicktheories.core.Gen<Integer> sizes)
      • ofType

        public ListsDSL.TypedListGeneratorBuilder<T> ofType​(Collector<T,​List<T>,​List<T>> collector)
        Determines how the Lists will be collected and returns an TypedListGeneratorBuilder with the Collector specified
        Parameters:
        collector - collector to use to construct list
        Returns:
        a TypedListGeneratorBuilder