All Downloads are FREE. Search and download functionalities are using the official Maven repository.

smallcheck.generators.StringGen Maven / Gradle / Ivy

The newest version!
package smallcheck.generators;

import java.util.stream.Stream;

/**
 *
 */
public class StringGen extends SeriesGen {

    private ArrayGen arrayGen = new ArrayGen<>(Character.class, new CharGen());

    @Override
    public Stream generate(int depth) {
        return arrayGen.generate(depth).map(ar -> {
            char[] chars = new char[ar.length];
            for (int i = 0; i < chars.length; i++) {
                chars[i] = ar[i];
            }
            return new String(chars);
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy