@SuppressWarnings({ "unchecked", "rawtypes" }) private static List<Value<?>> unwrapRaw(List<Object> objects) { List result = unwrap(objects); return result; }
@SuppressWarnings({ "unchecked", "rawtypes" }) private static List<Value<?>> unwrapRaw(List<Object> objects) { List result = unwrap(objects); return result; }
/** * 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. */ public static <T> ObjectGenerator<T> random(List<T> values) { return wrap(new DiscreteValue<>(unwrap(values))); }
/** * Creates an instance of {@link ObjectGenerator} which generates list containing all values specified. * * @param values List of values. * @param <T> Type instance of {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator} which generates list containing all values specified. */ public static <T> ObjectGenerator<List<T>> list(List<T> values) { return wrap(new ListValue<>(unwrap(values))); }
/** * Creates an instance of {@link ObjectGenerator} which generates list containing all values specified. * * @param values List of values. * @param <T> Type instance of {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator} which generates list containing all values specified. */ public static <T> ObjectGenerator<List<T>> list(List<T> values) { return wrap(new ListValue<>(unwrap(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. */ public static <T> ObjectGenerator<T> random(List<T> values) { return wrap(new DiscreteValue<>(unwrap(values))); }
/** * Creates an instance of {@link ObjectGenerator} which generates values in order they are specified. When values * are depleted, it starts again from the beginning of the list. * * @param values List of values. * @param <T> Type instance of {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator} which generates values in order they are specified. */ public static <T> ObjectGenerator<T> circular(List<T> values) { return wrap(new CircularValue<>(unwrap(values))); }
/** * Creates an instance of {@link ObjectGenerator} which generates values in order they are specified. When values * are depleted, it starts again from the beginning of the list. * * @param values List of values. * @param <T> Type instance of {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator} which generates values in order they are specified. */ public static <T> ObjectGenerator<T> circular(List<T> values) { return wrap(new CircularValue<>(unwrap(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. */ public static <T> ObjectGenerator<T> random(Distribution distribution, List<T> values) { return wrap(new DiscreteValue<>(unwrap(values), distribution)); }
/** * 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. */ public static <T> ObjectGenerator<T> random(Distribution distribution, List<T> values) { return wrap(new DiscreteValue<>(unwrap(values), distribution)); }