public abstract class StringGenerator
extends java.lang.Object
StringGenerator generates random strings composed of characters. What these characters
are and their distribution depends on a subclass.String| Constructor and Description |
|---|
StringGenerator() |
| Modifier and Type | Method and Description |
|---|---|
abstract java.lang.String |
ofCodePointsLength(java.util.Random r,
int minCodePoints,
int maxCodePoints) |
abstract java.lang.String |
ofCodeUnitsLength(java.util.Random r,
int minCodeUnits,
int maxCodeUnits) |
java.lang.String |
ofStringLength(java.util.Random r,
int minCodeUnits,
int maxCodeUnits)
An alias for
ofCodeUnitsLength(Random, int, int). |
public java.lang.String ofStringLength(java.util.Random r,
int minCodeUnits,
int maxCodeUnits)
ofCodeUnitsLength(Random, int, int).public abstract java.lang.String ofCodeUnitsLength(java.util.Random r,
int minCodeUnits,
int maxCodeUnits)
minCodeUnits - Minimum number of code units (inclusive).maxCodeUnits - Maximum number of code units (inclusive).minCodeUnits (inclusive)
and maxCodeUnits (inclusive) length. Code units are essentially
an equivalent of char type, see String class for
explanation.java.lang.IllegalArgumentException - Thrown if the generator cannot emit random string
of the given unit length. For example a generator emitting only extended unicodeGenerator
plane characters (encoded as surrogate pairs) will not be able to emit an odd number
of code units.public abstract java.lang.String ofCodePointsLength(java.util.Random r,
int minCodePoints,
int maxCodePoints)
minCodePoints - Minimum number of code points (inclusive).maxCodePoints - Maximum number of code points (inclusive).minCodePoints (inclusive)
and maxCodePoints (inclusive) length. Code points are full unicodeGenerator
codepoints or an equivalent of int type, see String class for
explanation. The returned String.length() may exceed maxCodeUnits
because certain code points may be encoded as surrogate pairs.Copyright © 2011–2018 Carrot Search s.c.. All rights reserved.