public final class RandomObjects
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static Tuple<ReplicationResponse.ShardInfo,ReplicationResponse.ShardInfo> |
randomShardInfo(java.util.Random random) |
Returns a tuple that contains a randomized
ReplicationResponse.ShardInfo value (left side) and its corresponding
value (right side) after it has been printed out as a ToXContent and parsed back using a parsing
method like ReplicationResponse.ShardInfo.fromXContent(XContentParser). |
static Tuple<ReplicationResponse.ShardInfo,ReplicationResponse.ShardInfo> |
randomShardInfo(java.util.Random random,
boolean withShardFailures) |
Returns a tuple that contains a randomized
ReplicationResponse.ShardInfo value (left side) and its corresponding
value (right side) after it has been printed out as a ToXContent and parsed back using a parsing
method like ReplicationResponse.ShardInfo.fromXContent(XContentParser). |
static BytesReference |
randomSource(java.util.Random random) |
Returns a random source containing a random number of fields, objects and array, with maximum depth 5.
|
static BytesReference |
randomSource(java.util.Random random,
XContentType xContentType) |
Returns a random source in a given XContentType containing a random number of fields, objects and array, with maximum depth 5.
|
static BytesReference |
randomSource(java.util.Random random,
XContentType xContentType,
int minNumFields) |
Returns a random source in a given XContentType containing a random number of fields, objects and array, with maximum depth 5.
|
static Tuple<java.util.List<java.lang.Object>,java.util.List<java.lang.Object>> |
randomStoredFieldValues(java.util.Random random,
XContentType xContentType) |
Returns a tuple containing random stored field values and their corresponding expected values once printed out
via
ToXContent.toXContent(XContentBuilder, ToXContent.Params) and parsed back via
XContentParser.objectText(). |
public static Tuple<java.util.List<java.lang.Object>,java.util.List<java.lang.Object>> randomStoredFieldValues(java.util.Random random, XContentType xContentType)
ToXContent.toXContent(XContentBuilder, ToXContent.Params) and parsed back via
XContentParser.objectText().
Generates values based on what can get printed out. Stored fields values are retrieved from lucene and converted via
MappedFieldType.valueForDisplay(Object) to either strings, numbers or booleans.random - Random generatorxContentType - the content type, used to determine what the expected values are for float numbers.public static BytesReference randomSource(java.util.Random random)
random - Random generatorpublic static BytesReference randomSource(java.util.Random random, XContentType xContentType)
random - Random generatorpublic static BytesReference randomSource(java.util.Random random, XContentType xContentType, int minNumFields)
random - Random generatorpublic static Tuple<ReplicationResponse.ShardInfo,ReplicationResponse.ShardInfo> randomShardInfo(java.util.Random random)
ReplicationResponse.ShardInfo value (left side) and its corresponding
value (right side) after it has been printed out as a ToXContent and parsed back using a parsing
method like ReplicationResponse.ShardInfo.fromXContent(XContentParser). The ShardInfo randomly contains shard failures.random - Random generatorpublic static Tuple<ReplicationResponse.ShardInfo,ReplicationResponse.ShardInfo> randomShardInfo(java.util.Random random, boolean withShardFailures)
ReplicationResponse.ShardInfo value (left side) and its corresponding
value (right side) after it has been printed out as a ToXContent and parsed back using a parsing
method like ReplicationResponse.ShardInfo.fromXContent(XContentParser). A `withShardFailures` parameter indicates if
the randomized ShardInfo must or must not contain shard failures.random - Random generatorwithShardFailures - indicates if the generated ShardInfo must contain shard failures