BoolGenerator.java

package net.morimekta.providence.testing.generator.defaults;

import net.morimekta.providence.testing.generator.GeneratorContext;
import net.morimekta.providence.testing.generator.Generator;

/**
 * Default generator for bool fields.
 */
public class BoolGenerator<Context extends GeneratorContext<Context>>
        implements Generator<Context, Boolean> {
    @Override
    public Boolean generate(Context ctx) {
        return ctx.getRandom().nextBoolean();
    }
}