/** * Creates an instance of {@link ObjectGenerator} which generates uniformly distributed values from specified list. * * @param values List of values. * @param <T> Type instance of {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator} which generates uniformly distributed values from specified list. */ @SafeVarargs public static <T> ObjectGenerator<T> random(T... values) { return random(Arrays.asList(values)); }
/** * Creates an instance of {@link ObjectGenerator} which generates uniformly distributed values from specified list. * * @param values List of values. * @param <T> Type instance of {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator} which generates uniformly distributed values from specified list. */ @SafeVarargs public static <T> ObjectGenerator<T> random(T... values) { return random(Arrays.asList(values)); }
/** * Creates an instance of {@link ObjectGenerator} which generates values distributed by specified distribution from * specified list. * * @param distribution Distribution to use. * @param values List of values. * @param <T> Type instance of {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator} which generates values distributed by specified distribution from * specified list. */ @SafeVarargs public static <T> ObjectGenerator<T> random(Distribution distribution, T... values) { return random(distribution, Arrays.asList(values)); }
/** * Creates an instance of {@link ObjectGenerator} which generates values distributed by specified distribution from * specified list. * * @param distribution Distribution to use. * @param values List of values. * @param <T> Type instance of {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator} which generates values distributed by specified distribution from * specified list. */ @SafeVarargs public static <T> ObjectGenerator<T> random(Distribution distribution, T... values) { return random(distribution, Arrays.asList(values)); }
/** * Creates an instance of {@link ObjectGenerator} which generates uniformly distributed values within specified * range. * * @param range The range. * @param <T> Type instance of {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator} which generates uniformly distributed values within specified * range. */ public static <T> ObjectGenerator<T> random(Range<T> range) { return random(range, RangeValue.defaultUseEdgeCases()); }
/** * Creates an instance of {@link ObjectGenerator} which generates uniformly distributed values within specified * range. * * @param range The range. * @param <T> Type instance of {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator} which generates uniformly distributed values within specified * range. */ public static <T> ObjectGenerator<T> random(Range<T> range) { return random(range, RangeValue.defaultUseEdgeCases()); }
/** * Creates an instance of {@link ObjectGenerator} which generates uniformly distributed values within specified * range and can force generating edge cases first. * * @param range The range. * @param useEdgeCases Determines whether to generate use cases first or not. * @param <T> Type instance of {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator} which generates uniformly distributed values within specified * range. */ public static <T> ObjectGenerator<T> random(Range<T> range, boolean useEdgeCases) { return random(range, useEdgeCases, RangeValue.defaultDistrbution()); }
/** * Creates an instance of {@link ObjectGenerator} which generates uniformly distributed values within specified * range and can force generating edge cases first. * * @param range The range. * @param useEdgeCases Determines whether to generate use cases first or not. * @param <T> Type instance of {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator} which generates uniformly distributed values within specified * range. */ public static <T> ObjectGenerator<T> random(Range<T> range, boolean useEdgeCases) { return random(range, useEdgeCases, RangeValue.defaultDistrbution()); }