// Path: datagen/src/main/java/io/qala/datagen/RandomShortApi.java
// public static int integer(int max) {
//     return between(0, max).integer();
// }


import java.util.ArrayList;
import java.util.List;
import static io.qala.datagen.RandomShortApi.integer;
package io.qala.datagen;



/**
 * If the resulting string should have repeats, this class can do this. Note, that often there are separators between
 * the repeats which should be trimmed at the end - and this trimming is the default behaviour. To switch it off
 * use {@link #includeLastSymbol()}.
 */
@SuppressWarnings("WeakerAccess")
public class Repeater {
    private final List<Object> toRepeat = new ArrayList<Object>();
    private int nOfLastSymbolsToRemove = 1;

    public static Repeater repeat(String toRepeat) {
        return new Repeater().string(toRepeat);
    }

    public static Repeater repeat(RandomValue randomValue, RandomString.Type type) {
        return new Repeater().random(randomValue, type);
    }

    public Repeater random(RandomValue randomValue, RandomString.Type type) {
        toRepeat.add(new RandomValueRecorder(randomValue, type));
        return this;
    }

    public Repeater string(String notRandomString) {
        toRepeat.add(notRandomString);
        return this;
    }

    public Repeater removeLastSymbols(int nOfSymbolsToRemoveFromTheEnd) {
        this.nOfLastSymbolsToRemove = nOfSymbolsToRemoveFromTheEnd;
        return this;
    }

    public Repeater includeLastSymbol() {
        this.nOfLastSymbolsToRemove = 0;
        return this;
    }

    public String times(int min, int max) {
        if(min < 0) throw new IllegalArgumentException("I cannot repeat string negative number of times");
// Path: datagen/src/main/java/io/qala/datagen/RandomShortApi.java
// public static int integer(int max) {
//     return between(0, max).integer();
// }


// Path: datagen/src/main/java/io/qala/datagen/Repeater.java
import java.util.ArrayList;
import java.util.List;
import static io.qala.datagen.RandomShortApi.integer;

package io.qala.datagen;



/**
 * If the resulting string should have repeats, this class can do this. Note, that often there are separators between
 * the repeats which should be trimmed at the end - and this trimming is the default behaviour. To switch it off
 * use {@link #includeLastSymbol()}.
 */
@SuppressWarnings("WeakerAccess")
public class Repeater {
    private final List<Object> toRepeat = new ArrayList<Object>();
    private int nOfLastSymbolsToRemove = 1;

    public static Repeater repeat(String toRepeat) {
        return new Repeater().string(toRepeat);
    }

    public static Repeater repeat(RandomValue randomValue, RandomString.Type type) {
        return new Repeater().random(randomValue, type);
    }

    public Repeater random(RandomValue randomValue, RandomString.Type type) {
        toRepeat.add(new RandomValueRecorder(randomValue, type));
        return this;
    }

    public Repeater string(String notRandomString) {
        toRepeat.add(notRandomString);
        return this;
    }

    public Repeater removeLastSymbols(int nOfSymbolsToRemoveFromTheEnd) {
        this.nOfLastSymbolsToRemove = nOfSymbolsToRemoveFromTheEnd;
        return this;
    }

    public Repeater includeLastSymbol() {
        this.nOfLastSymbolsToRemove = 0;
        return this;
    }

    public String times(int min, int max) {
        if(min < 0) throw new IllegalArgumentException("I cannot repeat string negative number of times");
        return times(integer(min, max));