public class UnicodeGenerator extends StringGenerator
Constructor and Description |
---|
UnicodeGenerator() |
Modifier and Type | Method and Description |
---|---|
String |
ofCodePointsLength(Random r,
int minCodePoints,
int maxCodePoints) |
String |
ofCodeUnitsLength(Random r,
int minCodeUnits,
int maxCodeUnits) |
String |
ofUtf8Length(Random r,
int minUtf8Length,
int maxUtf8Length)
Returns a random string that will have a random UTF-8 representation length between
minUtf8Length and maxUtf8Length . |
ofStringLength
public String ofCodeUnitsLength(Random r, int minCodeUnits, int maxCodeUnits)
ofCodeUnitsLength
in class StringGenerator
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.public String ofCodePointsLength(Random r, int minCodePoints, int maxCodePoints)
ofCodePointsLength
in class StringGenerator
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.public String ofUtf8Length(Random r, int minUtf8Length, int maxUtf8Length)
minUtf8Length
and maxUtf8Length
.minUtf8Length
- Minimum UTF-8 representation length (inclusive).maxUtf8Length
- Maximum UTF-8 representation length (inclusive).Copyright © 2011–2015 Carrot Search s.c.. All rights reserved.