Package org.apache.solr.bench
Class SolrGenerate
java.lang.Object
org.apache.solr.bench.SolrGenerate
The type Solr generate.
-
Method Summary
Modifier and TypeMethodDescriptionbooleans()Booleans solr gen.codePoints(int startInclusive, int endInclusive) Code points solr gen.static <T> SolrGen<T> constant(T constant) Constant solr gen.static <T> SolrGen<T> 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[]> Int arrays solr gen.longRange(long startInclusive, long endInclusive) Long range solr gen.static <T> SolrGen<T> Returns a generator that provides a value from a random generator provided.static <T> SolrGen<T> Randomly returns one of the supplied valuesrange(int startInclusive, int endInclusive) Range solr gen.
-
Method Details
-
constant
Constant solr gen.- Type Parameters:
T- the type parameter- Parameters:
constant- the constant- Returns:
- the solr gen
-
range
Range solr gen.- Parameters:
startInclusive- the start inclusiveendInclusive- the end inclusive- Returns:
- the solr gen
-
longRange
Long range solr gen.- Parameters:
startInclusive- the start inclusiveendInclusive- the end inclusive- Returns:
- the solr gen
-
intArrays
Int arrays solr gen.- Parameters:
sizes- the sizescontents- the contents- Returns:
- the solr gen
-
codePoints
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
-
booleans
Booleans solr gen.- Returns:
- the solr gen
-
pick
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
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
-