Package org.apache.solr.bench
Class SolrGenerate
- java.lang.Object
 - 
- org.apache.solr.bench.SolrGenerate
 
 
- 
public class SolrGenerate extends Object
The type Solr generate. 
- 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SolrGen<Boolean>booleans()Booleans solr gen.static SolrGen<Integer>codePoints(int startInclusive, int endInclusive)Code points solr gen.static <T> SolrGen<T>constant(T constant)Constant solr gen.static <T> SolrGen<T>frequency(List<org.quicktheories.api.Pair<Integer,SolrGen<T>>> weightedGens)Returns a generator that provides a value from a generator chosen with probability in proportion to the weight supplied in thePair.static <T> SolrGen<T>frequency(org.quicktheories.api.Pair<Integer,SolrGen<T>> mandatory, org.quicktheories.api.Pair<Integer,SolrGen<T>>... others)Returns a generator that provides a value from a generator chosen with probability in proportion to the weight supplied in thePair.static SolrGen<int[]>intArrays(SolrGen<Integer> sizes, SolrGen<Integer> contents)Int arrays solr gen.static SolrGen<Long>longRange(long startInclusive, long endInclusive)Long range solr gen.static <T> SolrGen<T>oneOf(SolrGen<T> mandatory, SolrGen<T>... others)Returns a generator that provides a value from a random generator provided.static <T> SolrGen<T>pick(List<T> ts)Randomly returns one of the supplied valuesstatic SolrGen<Integer>range(int startInclusive, int endInclusive)Range solr gen. 
 - 
 
- 
- 
Method Detail
- 
constant
public static <T> SolrGen<T> constant(T constant)
Constant solr gen.- Type Parameters:
 T- the type parameter- Parameters:
 constant- the constant- Returns:
 - the solr gen
 
 
- 
range
public static SolrGen<Integer> range(int startInclusive, int endInclusive)
Range solr gen.- Parameters:
 startInclusive- the start inclusiveendInclusive- the end inclusive- Returns:
 - the solr gen
 
 
- 
longRange
public static SolrGen<Long> longRange(long startInclusive, long endInclusive)
Long range solr gen.- Parameters:
 startInclusive- the start inclusiveendInclusive- the end inclusive- Returns:
 - the solr gen
 
 
- 
intArrays
public static SolrGen<int[]> intArrays(SolrGen<Integer> sizes, SolrGen<Integer> contents)
Int arrays solr gen.- Parameters:
 sizes- the sizescontents- the contents- Returns:
 - the solr gen
 
 
- 
codePoints
public static SolrGen<Integer> codePoints(int startInclusive, int endInclusive)
Code points solr gen.- Parameters:
 startInclusive- the start inclusiveendInclusive- the end inclusive- Returns:
 - the solr gen
 
 
- 
frequency
@SafeVarargs public static <T> SolrGen<T> frequency(org.quicktheories.api.Pair<Integer,SolrGen<T>> mandatory, org.quicktheories.api.Pair<Integer,SolrGen<T>>... others)
Returns a generator that provides a value from a generator chosen with probability in proportion to the weight supplied in thePair. Shrinking is towards the first non-zero weight in the list. At least one generator must have a positive weight and non-positive generators will never be chosen.- Type Parameters:
 T- Type to generate- Parameters:
 mandatory- Generator to sample fromothers- Other generators to sample- Returns:
 - A gen of T
 
 
- 
frequency
public static <T> SolrGen<T> frequency(List<org.quicktheories.api.Pair<Integer,SolrGen<T>>> weightedGens)
Returns a generator that provides a value from a generator chosen with probability in proportion to the weight supplied in thePair. Shrinking is towards the first non-zero weight in the list. At least one generator must have a positive weight and non-positive generators will never be chosen.- Type Parameters:
 T- Type to generate- Parameters:
 weightedGens- pairs of weight and generators to sample in proportion to their weighting- Returns:
 - A gen of T
 
 
- 
pick
public static <T> SolrGen<T> pick(List<T> ts)
Randomly returns one of the supplied values- Type Parameters:
 T- type of value to generate *- Parameters:
 ts- Values to pick from- Returns:
 - A Gen of T
 
 
- 
oneOf
@SafeVarargs public static <T> SolrGen<T> oneOf(SolrGen<T> mandatory, SolrGen<T>... others)
Returns a generator that provides a value from a random generator provided.- Type Parameters:
 T- Type to generate- Parameters:
 mandatory- Generator to sample fromothers- Other generators to sample from with equal weighting- Returns:
 - A gen of T
 
 
 - 
 
 -