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

com.github.javafaker.Options Maven / Gradle / Ivy

There is a newer version: 1.0.16
Show newest version
package com.github.javafaker;

public class Options {
    private final Faker faker;

    Options(Faker faker) {
        this.faker = faker;
    }


    public String option(String... options) {
        return options[faker.random().nextInt(options.length)];
    }

    public > E option(Class enumeration) {
        E[] enumConstants = enumeration.getEnumConstants();
        return enumConstants[faker.random().nextInt(enumConstants.length)];
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy