Class RealisticUnicodeGenerator


  • public class RealisticUnicodeGenerator
    extends StringGenerator
    A string generator that emits valid unicodeGenerator codepoints.
    • Field Detail

      • blockStarts

        private static final int[] blockStarts
        Index-aligned with blockEnds.
      • blockEnds

        private static final int[] blockEnds
        Index-aligned with blockStarts.
    • Constructor Detail

      • RealisticUnicodeGenerator

        public RealisticUnicodeGenerator()
    • Method Detail

      • ofCodeUnitsLength

        public java.lang.String ofCodeUnitsLength​(java.util.Random r,
                                                  int minCodeUnits,
                                                  int maxCodeUnits)
        Specified by:
        ofCodeUnitsLength in class StringGenerator
        minCodeUnits - Minimum number of code units (inclusive).
        maxCodeUnits - Maximum number of code units (inclusive).
        Returns:
        Returns a string of variable length between minCodeUnits (inclusive) and maxCodeUnits (inclusive) length. Code units are essentially an equivalent of char type, see String class for explanation.
      • ofCodePointsLength

        public java.lang.String ofCodePointsLength​(java.util.Random r,
                                                   int minCodePoints,
                                                   int maxCodePoints)
        Specified by:
        ofCodePointsLength in class StringGenerator
        minCodePoints - Minimum number of code points (inclusive).
        maxCodePoints - Maximum number of code points (inclusive).
        Returns:
        Returns a string of variable length between 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.